def get_resnet_experiments(exp): nb_branch = 2 if exp == 1: params = [[64, 128, 256, 512]] # params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] cov_outputs = [512] cov_mode = 'pmean' else: return batch_size = 128 mode_list = [1] cov_branch = 'o2t_no_wv' early_stop = True cov_regularizer = None last_config_feature_maps = [128] robust = False regroup = False cov_alpha = 0.2 # cov_beta = 0.1 cov_beta = 0.1 title = 'cifar10_resnet_{}'.format(cov_branch) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta) return config
def get_resnet_batch_norm(exp): nb_branch = 1 if exp == 1: params = [[]] # params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] cov_outputs = [200] cov_mode = 'pmean' else: return batch_size = 128 mode_list = [1] cov_branch = 'o2transform' early_stop = True cov_regularizer = None last_config_feature_maps = [] robust = False regroup = False cov_alpha = 1 # cov_beta = 0.1 cov_beta = 0.7 title = 'cifar10_cv_covBeta_{}_{}'.format(cov_beta, cov_branch) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta) return config
def get_cov_beta_cv(exp): if exp == 1: nb_branch = 1 params = [[257, 128, 64], ] cov_outputs = [params[0][2]] else: return batch_size = 128 cov_mode = 'pmean' mode_list = [1] cov_branch = 'o2transform' early_stop = True cov_regularizer = None last_config_feature_maps = [512] robust = True regroup = False cov_alpha = 0.75 # cov_beta = 0.1 cov_beta = 0.5 title = 'minc2500_cv_covBeta_{}_{}'.format(cov_beta, cov_branch) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta) return config
def get_experiment_settings(exp=1): cov_regularizer = None nb_branch = 1 dropout = False early_stop = True if exp == 1: params = [[], [64], [128], [100, 50], [128, 64], [512, 256], [128, 128, 128]] mode_list = [1] cov_outputs = [128, 64, 47, 32] cov_branch = 'o2transform' cov_mode = 'channel' dropout = False elif exp == 2: params = [[], [64], [128], [100, 50], [128, 64], [512, 256], [128, 128, 128]] mode_list = [1] cov_outputs = [128, 64, 47, 32] cov_branch = 'o2transform' cov_mode = 'mean' dropout = False elif exp == 3: params = [[], [64], [128], [100, 50], [128, 64], [512, 256], [128, 128, 128]] mode_list = [1] cov_outputs = [128, 64, 47, 32] cov_branch = 'o2transform' cov_mode = 'mean' dropout = True elif exp == 4: """Test VGG16 with DCov-2 """ params = [[]] mode_list = [1] cov_outputs = [256] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' elif exp == 5: """ Test LogTransform layers""" params = [[64, 64]] mode_list = [3] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True else: return config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, dropout=dropout, nb_branch=nb_branch) return config
def get_log_experiment(exp): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: """ log test """ nb_branch = 1 # params = [[513, 513, 513], [256, 256, 256]] # params = [[513, 513, 513, 513, 513, 513], [256, 256, 256, 256, 256]] params = [[513, 257, 129], [513, 513, 513]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'log' early_stop = False # cov_regularizer = 'Fob' last_config_feature_maps = [] last_config_feature_maps = [1024, 512] batch_size = 32 vectorization = 'wv' elif exp == 2: """ aaai paper test """ nb_branch = 1 # params = [[513, 513, 513], [256, 256, 256]] # params = [[513, 513, 513, 513, 513, 513], [256, 256, 256, 256, 256]] params = [[256, 128, 64], [513, 257, 129, 64]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'log' early_stop = False # cov_regularizer = 'Fob' last_config_feature_maps = [] last_config_feature_maps = [1024, 512] batch_size = 32 vectorization = 'dense' else: return config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, vectorization=vectorization, epsilon=1e-5) return config
def get_ResNet_testing_ideas(exp): """ Test VGG dimension reduction """ cov_regularizer = None if exp == 1: """ Experiment 1, cross validate number of branches. """ nb_branch = 2 # params = [[128, 64, 32], ] params = [[257, 128, 64], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'o2t_no_wv' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 2: """ Experiment 2, no robust """ nb_branch = 2 # params = [[128, 64, 32], ] params = [[257, 128, 64], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'o2t_no_wv' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = False else: return cov_mode = 'pmean' early_stop = True batch_size = 32 regroup = False cov_alpha = 0.75 if robust: rb = 'robost' else: rb = '' title = 'minc2500_RsNTEST_{}_{}_LC{}_exp_{}_{}'.format(cov_branch, rb, last_config_feature_maps, exp, concat) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, ) return config
def get_von_with_regroup(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 cov_alpha = 0.01 if exp == 1: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [[100, 50, 25], ] # params = [[512, 256, 128, 64], ] mode_list = [1] cov_outputs = [25] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None last_config_feature_maps = [] # last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 elif exp == 2: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None last_config_feature_maps = [] # last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 else: return if robust: rb = 'robost' else: rb = '' title = 'cifar10_von_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup) return config
def get_new_experiment(exp): batch_size = 128 cov_mode = 'pmean' mode_list = [1] cov_branch = 'o2t_no_wv' early_stop = False cov_regularizer = None last_config_feature_maps = [512] robust = True regroup = False cov_alpha = 0.3 # cov_beta = 0.1 cov_beta = 0.1 pooling = 'max' if exp == 1: nb_branch = 2 params = [[257, 128, 64], ] cov_outputs = [params[0][2]] elif exp == 2: nb_branch = 2 params = [[256, 512, 512], ] cov_outputs = [params[0][2]] elif exp == 3: nb_branch = 2 params = [[256,128,64,32]] cov_outputs = [params[0][2]] elif exp == 4: nb_branch = 2 params = [[512, 256, 128, 64,]] cov_outputs = [params[0][2]] last_config_feature_maps = [1024] elif exp == 5: nb_branch = 4 params = [[256, 128, 64, 32]] cov_outputs = [params[0][2]] elif exp == 6: nb_branch = 2 params = [[256, 128, 64, 32]] cov_outputs = [params[0][2]] pooling = 'avg' else: return title = 'mit_indoor_newexperiment_{}_{}_{}'.format(cov_mode, cov_branch, pooling) # weight_path = '/home/kyu/.keras/models/mit_indoor_baseline_resnet50.weights' weight_path = 'imagenet' config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta, weight_path=weight_path, pooling=pooling) return config
def get_constraints_settings(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 cov_alpha = 0.01 if exp == 1: """ Test Multi branch ResNet 50 """ nb_branch = 1 params = [ [256, 128, 64], ] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [3] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = None cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024, 512, 256] batch_size = 32 robust = True # cov_alpha = 0.75 else: return if robust: rb = 'robost' else: rb = '' title = 'dtd_cUN_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha) return config
def get_tensorboard_test_setting(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [ [257, 128, 64], [257, 128, 128, 64], ] mode_list = [1] cov_outputs = [64, 32] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True cov_alpha = 0.75 else: return if robust: rb = 'robost' else: rb = '' title = 'dtd_von_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha) return config
def get_aaai_experiment(exp): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: """ aaai paper test """ nb_branch = 1 # params = [[513, 513, 513], [256, 256, 256]] # params = [[513, 513, 513, 513, 513, 513], [256, 256, 256, 256, 256]] params = [[200, 100, 50]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [50] cov_mode = 'pmean' cov_branch = 'aaai' early_stop = False robust = False # cov_regularizer = 'Fob' # last_config_feature_maps = [] last_config_feature_maps = [] # last_config_feature_maps = [1024, 512, 256] batch_size = 32 vectorization = 'dense' elif exp == 2: """ aaai paper test """ nb_branch = 2 # params = [[513, 513, 513], [256, 256, 256]] # params = [[513, 513, 513, 513, 513, 513], [256, 256, 256, 256, 256]] params = [[200, 100, 50]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [50] cov_mode = 'mean' cov_branch = 'aaai' early_stop = False robust = False # cov_regularizer = 'Fob' # last_config_feature_maps = [] last_config_feature_maps = [1024, 512] batch_size = 32 vectorization = 'flatten' else: return title = 'aaai_baseline' config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, vectorization=vectorization, epsilon=1e-5, title=title, robust=robust) return config
def get_residual_cov_experiment(exp): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: """ Test Residual learning of covariance branch """ nb_branch = 1 # params = [[513, 513, 513], [256, 256, 256]] # params = [[513, 513, 513, 513, 513, 513], [256, 256, 256, 256, 256]] params = [[65, 65, 65, 65]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'pmean' cov_branch = 'residual' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] # last_config_feature_maps = [1024, 512] robust = False elif exp == 2: """ Test Multi branch ResNet 50 """ nb_branch = 4 params = [[513, 513, 513, 513, 513, 513], [513, 513, 513], [256, 256, 256]] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'pmean' cov_branch = 'residual' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] # last_config_feature_maps = [1024] robust = True else: return if robust: rb = 'robost' else: rb = '' batch_size = 128 cov_alpha = 0.3 title = 'cifar10_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, title=title, robust=robust, cov_alpha=cov_alpha) return config
def get_resnet_with_power(exp): nb_branch = 1 if exp == 1: params = [[64,128,256]] # params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] cov_outputs = [200] cov_mode = 'pmean' vectorization = 'wv' elif exp == 2: params = [[]] # params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] cov_outputs = [64] cov_mode = 'pmean' vectorization = 'mat_flatten' else: return batch_size = 128 mode_list = [1] cov_branch = 'pow_o2t' early_stop = True cov_regularizer = None last_config_feature_maps = [] robust = False regroup = False cov_alpha = 0.2 # cov_beta = 0.1 cov_beta = 0.1 title = 'cifar10_cv_pow-o2t_{}_{}'.format(cov_beta, cov_branch) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta, vectorization=vectorization) return config
def get_iccv_experiment(exp): cov_regularizer = None if exp == 1: """ aaai paper test """ nb_branch = 1 params = [ [], ] mode_list = [1] cov_outputs = [256] cov_mode = 'channel' cov_branch = 'pow_o2t' early_stop = False robust = False # cov_regular izer = 'Frob' # last_config_feature_maps = [] last_config_feature_maps = [256] batch_size = 32 vectorization = 'mat_flatten' else: return title = 'iccv_issecond_baseline' config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, vectorization=vectorization, epsilon=1e-5, title=title, robust=robust) return config
def get_matrix_bp(exp=1): if exp == 1: """ Test get matrix bp learning """ nb_branch = 1 mode_list = [1] elif exp == 2: """ Test get matrix back prop with multi branch """ nb_branch = 1 mode_list = [1] elif exp == 3: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 mode_list = [3] else: return params = [[]] cov_outputs = [64] cov_mode = 'channel' cov_branch = 'matbp' early_stop = True cov_regularizer = None last_config_feature_maps = [] batch_size = 128 robust = False regroup = False cov_alpha = 0.75 concat = 'concat' if robust: rb = 'robost' else: rb = '' title = 'cifar10_matbp_basline_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, normalization=None) return config
def get_residual_cov_experiment(exp): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: """ Test Multi branch ResNet 50 """ nb_branch = 1 params = [ [ 257, 257, 257, ], [257, 257, 257, 257, 257, 257], ] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'residual' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] last_config_feature_maps = [1024, 512, 256] batch_size = 32 robust = False elif exp == 2: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 2 params = [ [257, 257, 257], ] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'residual' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True cov_alpha = 0.75 else: return if robust: rb = 'robost' else: rb = '' title = 'dtd_von_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, robust=robust, cov_alpha=cov_alpha, title=title) return config
def get_ResNet_testing_ideas(exp): """ Test VGG dimension reduction """ cov_regularizer = None normalization = 'mean' cov_mode = 'pmean' if exp == 1: """ Experiment 1, cross validate number of branches. """ nb_branch = 2 # params = [[128, 64, 32], ] params = [ [257, 128, 64, 32], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][3]] cov_branch = 'o2t_no_wv' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 2: """ Experiment 2, robust """ nb_branch = 2 # params = [[128, 64, 32], ] params = [ [257, 128, 64], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'o2t_no_wv' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 3: """ Experiment 3 June 27 2017, no 1x1 and train from scratch """ nb_branch = 2 # params = [[128, 64, 32], ] params = [ [257, 128, 64], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'multiple_o2t' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = False elif exp == 4: nb_branch = 2 params = [ [], ] # params = [[256,]] mode_list = [1] cov_outputs = [128] last_config_feature_maps = [1024] cov_branch = 'o2transform' normalization = 'mean' # cov_branch = 'o2t_no_wv' cov_regularizer = None concat = 'concat' robust = True elif exp == 5: """ 2017.8.15 New PV test with l2 normalization and sqrt after PV """ nb_branch = 1 params = [ [128], ] mode_list = [1] cov_outputs = [128] last_config_feature_maps = [1024] cov_branch = 'new_wv' normalization = 'mean' cov_regularizer = None concat = 'concat' robust = False cov_mode = 'channel' else: return early_stop = False batch_size = 32 finetune_batch_size = 128 regroup = False cov_alpha = 0.3 cov_beta = 0.1 if robust: rb = 'robost' else: rb = '' title = 'sun397_ResNetTest_{}_{}_LC{}_exp_{}_{}'.format( cov_branch, rb, last_config_feature_maps, exp, concat) config = DCovConfig( params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, cov_beta=cov_beta, regroup=regroup, concat=concat, weight_path='imagenet', finetune_batch_size=finetune_batch_size, normalization=normalization, ) return config
def get_von_settings(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 cov_alpha = 0.01 if exp == 1: """ Test Multi branch ResNet 50 """ nb_branch = 1 params = [[256, 128, 64],] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = False # cov_regularizer = None # cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024, 512, 256] batch_size = 32 robust = True cov_alpha = 0.75 elif exp == 2: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = False cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = False elif exp == 3: """ Test Multi branch ResNet 50 """ nb_branch = 1 params = [[256, 128, 64], ] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = False cov_regularizer = None # cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024, 512, 256] batch_size = 32 robust = True cov_alpha = 0.75 elif exp == 4: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'pmean' cov_branch = 'o2transform' early_stop = False cov_regularizer = None # cov_regularizer = 'vN' # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True cov_alpha = 0.75 else: return if robust: rb = 'robost' else: rb = '' title = 'minc_von_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha) return config
def get_VGG_dimension_reduction(exp=1): """ Test VGG dimension reduction """ cov_regularizer = None if exp == 1: nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None last_config_feature_maps = [1024] concat = 'concat' elif exp == 2: nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' # last_config_feature_maps = [] last_config_feature_maps = [1024] concat = 'concat' elif exp == 3: nb_branch = 4 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' # last_config_feature_maps = [] last_config_feature_maps = [1024] concat = 'concat' elif exp == 4: nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None last_config_feature_maps = [1024] concat = 'sum' elif exp == 5: nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2t_no_wv' # last_config_feature_maps = [] last_config_feature_maps = [1024] concat = 'sum' elif exp == 6: nb_branch = 2 params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2t_no_wv' # last_config_feature_maps = [] last_config_feature_maps = [1024] concat = 'avg' else: return cov_mode = 'pmean' early_stop = True batch_size = 32 robust = True regroup = False cov_alpha = 0.75 if robust: rb = 'robost' else: rb = '' title = 'minc2500_DR_{}_{}_LC{}'.format(cov_mode, rb, last_config_feature_maps) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat) return config
def get_matrix_bp(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 cov_alpha = 0.01 if exp == 1: """ Test get matrix bp learning """ nb_branch = 1 params = [[]] mode_list = [1] cov_outputs = [64] cov_mode = 'channel' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [256] batch_size = 32 robust = False regroup = False cov_alpha = 0.75 concat = 'concat' elif exp == 2: """ Test get matrix back prop with multi branch """ nb_branch = 2 params = [[]] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'concat' elif exp == 3: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [ [257, 128, 64], ] mode_list = [3] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None last_config_feature_maps = [] # last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'concat' else: return if robust: rb = 'robost' else: rb = '' title = 'dtd_baseline_matbp_von_{}_{}_{}_{}'.format( cov_mode, cov_branch, rb, cov_regularizer) weight_path = '/home/kyu/.keras/models/tmp/VGG16_o2_para-mode_1_matbp_784_finetune.weights' config = DCovConfig( params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, weight_path=weight_path, ) return config
def get_experiment_settings(exp=1): cov_regularizer = None nb_branch = 1 batch_size = 32 last_config_feature_maps = [] if exp == 1: params = [[], [1024], [512], [1024, 512], [512, 256], [2048, 1444], [2048, 1024, 512]] mode_list = [1] cov_outputs = [512, 256, 128, 64] cov_branch = 'o2transform' cov_mode = 'channel' early_stop = True elif exp == 2: params = [[1024], [512], [1024, 512], [512, 256], [2048, 1444], [2048, 1024, 512]] mode_list = [1] cov_outputs = [512, 256, 128, 64] cov_branch = 'o2transform' cov_mode = 'mean' early_stop = True elif exp == 3: """Test the Regularizer """ params = [[]] mode_list = [1] cov_outputs = [512, 256, 128] cov_mode = 'channel' cov_branch = 'o2transform' early_stop = True cov_regularizer = 'Fob' elif exp == 4: """Test VGG16 with DCov-2 """ params = [[]] mode_list = [1] cov_outputs = [256] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' elif exp == 5: """ Test LogTransform layers""" params = [[]] mode_list = [3] cov_outputs = [256] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True elif exp == 6: """ Test ResNet 50 """ params = [[256, 128]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [1024, 512] # last_config_feature_maps = [] elif exp == 7: """ Test ResNet 50 with different branches """ nb_branch = 4 params = [[256, 128]] mode_list = [1] cov_outputs = [128] cov_mode = 'pmean' # cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] # last_config_feature_maps = [] batch_size = 16 else: return config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size) return config
def get_experiment_settings(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 if exp == 1: params = [[], [1024], [512], [1024, 512], [512, 256], [2048, 1444], [2048, 1024, 512]] mode_list = [1] cov_outputs = [512, 256, 128, 64] cov_branch = 'o2transform' cov_mode = 'channel' early_stop = True elif exp == 2: params = [[1024], [512], [1024, 512], [512, 256], [2048, 1444], [2048, 1024, 512]] mode_list = [1] cov_outputs = [512, 256, 128, 64] cov_branch = 'o2transform' cov_mode = 'mean' early_stop = True elif exp == 3: """Test the Regularizer """ params = [[]] mode_list = [1] cov_outputs = [512, 256, 128] cov_mode = 'channel' cov_branch = 'o2transform' early_stop = True cov_regularizer = 'Fob' elif exp == 4: """Test VGG16 with DCov-2 """ params = [[256, 128]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' # last_config_feature_maps = [256] batch_size = 32 elif exp == 5: """ Test ResNet 50 """ params = [[256, 128], [256, 128, 64], [256], [128], [256, 256, 128],] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' # last_config_feature_maps = [] last_config_feature_maps = [1024, 512] batch_size = 32 elif exp == 6: """ Test Multi branch ResNet 50 """ # nb_branch = 4 nb_branch = 8 params = [[256, 128], [256, 128, 64],] # params = [[1024, 512], [1024, 512, 256], [512, 256]] mode_list = [1] cov_outputs = [128, 64] cov_mode = 'mean' cov_branch = 'o2transform' early_stop = True # cov_regularizer = 'Fob' last_config_feature_maps = [] # last_config_feature_maps = [1024, 512] batch_size = 32 else: return config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp) return config
def get_matrix_bp_vgg(exp=1): if exp == 1: """ Test get matrix bp learning """ nb_branch = 1 params = [[]] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024, 512] batch_size = 32 robust = False regroup = False cov_alpha = 0.75 concat = 'concat' elif exp == 2: """ Test get matrix back prop with multi branch """ nb_branch = 2 params = [[]] mode_list = [1] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'concat' elif exp == 3: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [[257, 128, 64], ] mode_list = [3] cov_outputs = [64] cov_mode = 'mean' cov_branch = 'matbp' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None last_config_feature_maps = [] # last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'concat' else: return if robust: rb = 'robost' else: rb = '' title = 'minc_baseline_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, normalization=None) return config
def get_different_concat(exp=1): cov_regularizer = None nb_branch = 1 last_config_feature_maps = [] batch_size = 4 cov_alpha = 0.01 if exp == 1: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 4 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'pmean' cov_branch = 'o2t_no_wv' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [] batch_size = 10 robust = True regroup = False cov_alpha = 0.75 concat = 'matrix_diag' elif exp == 2: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 2 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'pmean' cov_branch = 'o2t_no_wv' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'matrix_diag' elif exp == 3: """ Test Multi_branch Resnet 50 with residual learning """ nb_branch = 2 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_mode = 'pmean' cov_branch = 'o2t_no_wv' early_stop = False # cov_regularizer = 'vN' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [1024] batch_size = 32 robust = True regroup = False cov_alpha = 0.75 concat = 'sum' else: return if robust: rb = 'robost' else: rb = '' title = 'dtd_diagcc_{}_{}_{}_{}'.format(cov_mode, cov_branch, rb, cov_regularizer) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat) return config
def get_VGG_correlation(exp): cov_regularizer = None if exp == 1: """ Test Multiple o2t with so bn""" nb_branch = 2 params = [ [257, 128, 64, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True so_mode = 2 elif exp == 2: """ Test Multiple o2t with so bn""" nb_branch = 2 # params = [[64, 64, 32], ] # params = [[257, 128, 64], ] params = [ [257, 128, 64, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'corr' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True so_mode = 2 else: return cov_mode = 'pmean' early_stop = False batch_size = 32 regroup = False cov_alpha = 0.75 if robust: rb = 'robost' else: rb = '' title = 'sun397_VGG_Corr_{}_{}_LC{}_exp_{}_{}'.format( cov_branch, rb, last_config_feature_maps, exp, concat) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, vectorization=None, load=False, so_mode=so_mode) return config
def get_VGG_testing_ideas(exp): """ Test VGG dimension reduction """ cov_regularizer = None if exp == 1: """ Experiment 1, cross validate number of branches. """ nb_branch = 2 # params = [[128, 64, 32], ] params = [ [257, 128, 64], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'o2t_no_wv' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 2: """ Cross Validate on the summing methods """ nb_branch = 2 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'ave' last_avg = False robust = False elif exp == 3: """ Test with robust single branch""" nb_branch = 1 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [512] concat = 'concat' last_avg = False robust = True elif exp == 4: """ Cross Validate on the summing methods for Riemannian""" nb_branch = 2 # params = [[128, 64, 32],] params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2t_no_wv' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 5: """ Cross Validate on the summing methods for Riemannian""" nb_branch = 2 params = [ [64, 64, 32], ] # params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'multiple_o2t' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 6: """ Test Multiple o2t with so bn""" nb_branch = 2 params = [ [64, 64, 32], ] # params = [[257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'sobn_multiple_o2t' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 7: """ Test the Multi-branch with FPN network (Kaiming CVPR) """ nb_branch = 2 params = [[256, 128, 64, 64]] mode_list = [4] cov_outputs = [64] cov_branch = 'o2t_no_wv' cov_regularizer = None last_config_feature_maps = [512] concat = 'concat' robust = True else: return cov_mode = 'pmean' early_stop = False batch_size = 32 regroup = False cov_alpha = 0.3 if robust: rb = 'robost' else: rb = '' title = 'sun397_VGGTEST_{}_{}_LC{}_exp_{}_{}'.format( cov_branch, rb, last_config_feature_maps, exp, concat) config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, vectorization=None, load=False, normalization=None) return config
def get_experiment_settings(exp=1): nb_branch = 1 batch_size = 128 if exp == 1: params = [[64, 32, 16], [25, 25, 25],] cov_outputs = [16] cov_mode = 'pmean' elif exp == 2: """ Test fitnet with simple settings """ nb_branch = 2 params = [[100, 50, 25], ] cov_outputs = [64] cov_mode = 'pmean' elif exp == 3: # params = [[64, 64, 64], [100, 100, 100], [50, 50, 50],] # params = [[64], [64, 128], [64,128,256],] params = [[64], [64, 32], [64,32,16],] cov_outputs = [] cov_mode = 'pmean' title = 'cifar10_CrossV-WV_{}'.format(cov_mode, ) elif exp == 4: params = [[30], [50], [70]] # params = [[], [50,], [70], [64,64,64]] # cov_outputs = range(10, 201, 20) cov_outputs = range(20, 201, 20) cov_mode = 'pmean' title = 'cifar10_CrossV-WV_{}'.format(cov_mode,) elif exp == 5: # params = [[50, 40, 30], [50, 60, 70], [50,30,10], [50, 70, 90]] # params = [[50, 100, 200, 400,],] # params = [[50,50,50,50],] # params = [[50,50,50,50, 50],] params = [[50, 100, 200, 400,],] # params = [[50, 100, 200, 400, 800],] # params = [[800,400,200,100,50]] # params = [[50, 50, 50]] # params = [[50, 50,], [50], [50,50,50]] # params = [[50, 50,], [50], [50,50,50]] # params = [[50, 100, 200], [50, 100], [100,50], [200,100,50]] cov_outputs = [params[0][-1]] cov_mode = 'pmean' title = 'cifar10-CrossV-O2T_{}_'.format(cov_mode) elif exp == 6: params = [[50, 25], [50, 75], ] cov_outputs = [25, 50, 75] cov_mode = 'pmean' title = 'cifar10-CrossV-O2T_{}_'.format(cov_mode) elif exp == 7: # params = [[64,64,64]] # params = [[190], [170],[110], [30 ]] # params = [[90]] params = [[70]] # params = [[50]] # params = [[30]] # cov_outputs = [200, 160, 80, 40] # 90 # cov_outputs = [190, 170, ] # 70 # cov_outputs = [20] # 50 cov_outputs = [40,70,10] # 30 # cov_outputs = [50] cov_mode = 'pmean' title = 'cifar10-CrossV-O2T_{}_'.format(cov_mode) elif exp == 8: # params = [[]] # params = [[150]] params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] # cov_outputs = range(20, 201, 20) cov_outputs = range(220, 401, 20) cov_mode = 'pmean' title = 'cifar10_CrossV-WV_{}'.format(cov_mode,) elif exp == 9: params = [[150]] # params = [[100]] # params = [[90]] # params = [[70]] # params = [[50]] # params = [[30]] cov_outputs = range(10, 201, 20) cov_mode = 'pmean' title = 'cifar10_CrossV-WV_{}'.format(cov_mode,) else: return mode_list = [1] cov_branch = 'o2transform' early_stop = True cov_regularizer = None last_config_feature_maps = [] robust = False regroup = False cov_alpha = 1 cov_beta = 0.1 if robust: rb = 'robost' else: rb = '' config = DCovConfig(params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, cov_beta=cov_beta) return config
def get_VGG_testing_ideas(exp): """ Test VGG dimension reduction """ cov_regularizer = None if exp == 1: """ Experiment 1, cross validate number of branches. """ nb_branch = 4 # params = [[128, 64, 32], ] # params = [[257, 128, 64], ] params = [ [257, 128, 128], ] # params = [[64, 32, 16], ] mode_list = [1] # cov_outputs = [16] cov_outputs = [params[0][2]] cov_branch = 'o2t_no_wv' cov_regularizer = None # last_config_feature_maps = [512] last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True elif exp == 2: """ Cross Validate on the summing methods """ nb_branch = 2 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'ave' last_avg = False robust = False elif exp == 3: """ Test with robust single branch""" nb_branch = 1 params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2transform' cov_regularizer = None # last_config_feature_maps = [] last_config_feature_maps = [512] concat = 'concat' last_avg = False robust = True elif exp == 4: """ Cross Validate on the summing methods for Riemannian""" nb_branch = 2 # params = [[128, 64, 32],] params = [ [257, 128, 64], ] mode_list = [1] cov_outputs = [64] cov_branch = 'o2t_no_wv' cov_regularizer = None last_config_feature_maps = [512] # last_config_feature_maps = [1024] concat = 'concat' last_avg = False robust = True else: return cov_mode = 'pmean' early_stop = True batch_size = 32 regroup = False cov_alpha = 0.75 if robust: rb = 'robost' else: rb = '' cov_beta = 0.3 title = 'ImageNet_VGG16_{}_{}_LC{}_exp_{}_{}'.format( cov_branch, rb, last_config_feature_maps, exp, concat) config = DCovConfig( params, mode_list, cov_outputs, cov_branch, cov_mode, early_stop, cov_regularizer, nb_branch=nb_branch, last_conv_feature_maps=last_config_feature_maps, batch_size=batch_size, exp=exp, epsilon=1e-5, title=title, robust=robust, cov_alpha=cov_alpha, regroup=regroup, concat=concat, cov_beta=cov_beta, ) return config