<jupyter_start><jupyter_text>** Aeroplane Vs All  **<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 0
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>Using TensorFlow backend.
/content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/src/utils/visualization/mosaic_plot.py:2: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.6/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python3.6/dist-packages/ipykernel/kernelapp.py", line 477, in start
    io[...]<jupyter_text>** AUTOMOBILE VS All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 1
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>[INFO:] Loading data...
The normal label used in experiment, 1
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
Inside the CIFAR10_DataLoader RCAE.RESULT_PATH: /content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/reports/figures/cifar10/RCAE/
[INFO:] Loading data...
The normal label used in experiment, 1
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
[INFO:] Assertions of memory muted
The shape of Training data :  (6500, 32, 32, 3)
The shape of POS data :  (6000, 32, 32, 3)
The shape of NEG data :  (500, 32, 32, 3)
Starting training...
Using GridSearchCV for hyperparameter selection...
Starting prediction...
Total elapsed time: 2.98006
Starting prediction...
Total elapsed time: 3.00008
Starting prediction...
Total elapsed time: 3.01439
Starting prediction...
Total elapsed time: 3.04085
Starting prediction...
Total elapse[...]<jupyter_text>** BIRD  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 2
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>Using TensorFlow backend.
/content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/src/utils/visualization/mosaic_plot.py:2: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.6/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python3.6/dist-packages/ipykernel/kernelapp.py", line 477, in start
    io[...]<jupyter_text>** CAT  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 3
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>Using TensorFlow backend.
/content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/src/utils/visualization/mosaic_plot.py:2: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.6/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python3.6/dist-packages/ipykernel/kernelapp.py", line 477, in start
    io[...]<jupyter_text>** DEER  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 4
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>[INFO:] Loading data...
The normal label used in experiment, 4
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
Inside the CIFAR10_DataLoader RCAE.RESULT_PATH: /content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/reports/figures/cifar10/RCAE/
[INFO:] Loading data...
The normal label used in experiment, 4
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
[INFO:] Assertions of memory muted
The shape of Training data :  (6500, 32, 32, 3)
The shape of POS data :  (6000, 32, 32, 3)
The shape of NEG data :  (500, 32, 32, 3)
Starting training...
Using GridSearchCV for hyperparameter selection...
Starting prediction...
Total elapsed time: 3.06473
Starting prediction...
Total elapsed time: 3.04153
Starting prediction...
Total elapsed time: 3.10126
Starting prediction...
Total elapsed time: 3.2483
Starting prediction...
Total elapsed[...]<jupyter_text>** DOG  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 5
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>Using TensorFlow backend.
/content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/src/utils/visualization/mosaic_plot.py:2: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'module://ipykernel.pylab.backend_inline' by the following code:
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.6/dist-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/local/lib/python3.6/dist-packages/ipykernel/kernelapp.py", line 477, in start
    io[...]<jupyter_text>** FROG  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 6
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>[INFO:] Loading data...
The normal label used in experiment, 6
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
Inside the CIFAR10_DataLoader RCAE.RESULT_PATH: /content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/reports/figures/cifar10/RCAE/
[INFO:] Loading data...
The normal label used in experiment, 6
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
[INFO:] Assertions of memory muted
The shape of Training data :  (6500, 32, 32, 3)
The shape of POS data :  (6000, 32, 32, 3)
The shape of NEG data :  (500, 32, 32, 3)
Starting training...
Using GridSearchCV for hyperparameter selection...
Starting prediction...
Total elapsed time: 3.01791
Starting prediction...
Total elapsed time: 3.03815
Starting prediction...
Total elapsed time: 3.01979
Starting prediction...
Total elapsed time: 3.03642
Starting prediction...
Total elapse[...]<jupyter_text>** HORSE  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 7
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>[INFO:] Loading data...
The normal label used in experiment, 7
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
Inside the CIFAR10_DataLoader RCAE.RESULT_PATH: /content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/reports/figures/cifar10/RCAE/
[INFO:] Loading data...
The normal label used in experiment, 7
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
[INFO:] Assertions of memory muted
The shape of Training data :  (6500, 32, 32, 3)
The shape of POS data :  (6000, 32, 32, 3)
The shape of NEG data :  (500, 32, 32, 3)
Starting training...
Using GridSearchCV for hyperparameter selection...
Starting prediction...
Total elapsed time: 3.06272
Starting prediction...
Total elapsed time: 3.05488
Starting prediction...
Total elapsed time: 3.04778
Starting prediction...
Total elapsed time: 3.02241
Starting prediction...
Total elapse[...]<jupyter_text>** SHIP  vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 8
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output>[INFO:] Loading data...
The normal label used in experiment, 8
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
Inside the CIFAR10_DataLoader RCAE.RESULT_PATH: /content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/reports/figures/cifar10/RCAE/
[INFO:] Loading data...
The normal label used in experiment, 8
INFO: Random Seed set is  42
x_outlier shape: (500, 32, 32, 3)
_X_test_beforegcn, (6500, 32, 32, 3) 1.0 0.0
Data loaded.
[INFO:] Assertions of memory muted
The shape of Training data :  (6500, 32, 32, 3)
The shape of POS data :  (6000, 32, 32, 3)
The shape of NEG data :  (500, 32, 32, 3)
Starting training...
Using GridSearchCV for hyperparameter selection...
Starting prediction...
Total elapsed time: 3.05699
Starting prediction...
Total elapsed time: 3.09469
Starting prediction...
Total elapsed time: 3.15823
Starting prediction...
Total elapsed time: 3.38305
Starting prediction...
Total elapse[...]<jupyter_text>** Truck vs All<jupyter_code>## Obtaining the training and testing data
%reload_ext autoreload
%autoreload 2

import numpy as np 
from src.config import Configuration as Cfg
from src.models.svm import SVM


DATASET = "cifar10"
ESTIMATORS = 100
MAX_SAMPLES = 250
CONTAMINATION = 0.1
MODEL_SAVE_PATH = PROJECT_DIR + "/models/cifar10/OCSVM_SVDD/"
REPORT_SAVE_PATH = PROJECT_DIR + "/reports/figures/cifar10/OCSVM_SVDD/"

PRETRAINED_WT_PATH = ""
RANDOM_SEED = [42,56,81,67,33,25,90,77,15,11]
AUC = []



## Setting the required config values
Cfg.out_frac = 0.1
Cfg.ad_experiment = 1                 # 1 : yes # 0 : No
Cfg.unit_norm_used = "l1"
Cfg.gcn = 1                           # 1 : yes # 0 : No
Cfg.zca_whitening = 0                  # 1 : yes # 0 : No
Cfg.pca = 0 # 1 for yes # 0 : No
Cfg.cifar10_val_frac = 0.1
Cfg.cifar10_normal = 9
Cfg.cifar10_outlier = -1


 # SVM parameters
Cfg.svm_nu = 0.1
Cfg.svm_GridSearchCV = 1

for seed in RANDOM_SEED:  
    
   # plot parameters
   # Cfg.xp_path = REPORT_SAVE_PATH

    # dataset
    Cfg.seed = seed
    
    
    # initialize OC-SVM
    ocsvm = SVM(loss="OneClassSVM", dataset=DATASET, kernel="rbf")

    # train OC-SVM model
    ocsvm.fit(GridSearch=Cfg.svm_GridSearchCV)

    # predict scores
    auc_roc = ocsvm.predict(which_set='test')
   
    print("========================================================================",)
    print("AUROC: ",auc_roc)
    print("========================================================================",)
    AUC.append(auc_roc)

    
print("===========AURO Computed============================")
print("AUROC computed ", AUC)
auc_roc_mean = np.mean(np.asarray(AUC))
auc_roc_std = np.std(np.asarray(AUC))
print ("AUROC =====", auc_roc_mean*100 ,"+/-",auc_roc_std*100)
print("========================================================================")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20355318995900165, 'fraction_numerical': 0.04786736675537654, 'mean_word_length': 3.9851201147364645, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '321453', 'license': 'MIT', 'n_tokens_mistral': 11078, 'n_tokens_neox': 9641, 'n_words': 2350, 'path': 'notebooks/OCSVM_SVDD/OCSVM_SVDD_CIFAR10.ipynb', 'repo_name': 'chihyunsong/oc-nn', 'size': '27806'}