Modif Dataugv6

This commit is contained in:
Harle, Antoine (Contracteur) 2019-12-02 06:37:19 -05:00
parent ebee1b789f
commit 3ec99bf729
6 changed files with 334 additions and 36 deletions

View file

@ -5,21 +5,21 @@ from train_utils import *
tf_names = [
## Geometric TF ##
#'Identity',
#'FlipUD',
#'FlipLR',
#'Rotate',
#'TranslateX',
#'TranslateY',
#'ShearX',
#'ShearY',
'Identity',
'FlipUD',
'FlipLR',
'Rotate',
'TranslateX',
'TranslateY',
'ShearX',
'ShearY',
## Color TF (Expect image in the range of [0, 1]) ##
#'Contrast',
#'Color',
#'Brightness',
#'Sharpness',
#'Posterize',
'Contrast',
'Color',
'Brightness',
'Sharpness',
'Posterize',
'Solarize', #=>Image entre [0,1] #Pas opti pour des batch
#Color TF (Common mag scale)
@ -44,10 +44,10 @@ tf_names = [
#'BadTranslateY',
#'BadTranslateY_neg',
#'BadColor',
#'BadSharpness',
#'BadContrast',
#'BadBrightness',
'BadColor',
'BadSharpness',
'BadContrast',
'BadBrightness',
#Non fonctionnel
#'Auto_Contrast', #Pas opti pour des batch (Super lent)
@ -65,7 +65,7 @@ else:
if __name__ == "__main__":
n_inner_iter = 10
epochs = 1
epochs = 100
dataug_epoch_start=0
#### Classic ####
@ -95,12 +95,12 @@ if __name__ == "__main__":
t0 = time.process_time()
tf_dict = {k: TF.TF_dict[k] for k in tf_names}
#tf_dict = TF.TF_dict
aug_model = Augmented_model(Data_augV5(TF_dict=tf_dict, N_TF=1, mix_dist=0.0, fixed_prob=True, fixed_mag=False, shared_mag=True), LeNet(3,10)).to(device)
aug_model = Augmented_model(Data_augV6(TF_dict=tf_dict, N_TF=3, mix_dist=0.0, fixed_prob=False, fixed_mag=True, shared_mag=True), LeNet(3,10)).to(device)
#aug_model = Augmented_model(Data_augV5(TF_dict=tf_dict, N_TF=2, mix_dist=0.5, fixed_mag=True, shared_mag=True), WideResNet(num_classes=10, wrn_size=160)).to(device)
#aug_model = Augmented_model(RandAug(TF_dict=tf_dict, N_TF=2), LeNet(3,10)).to(device)
print(str(aug_model), 'on', device_name)
#run_simple_dataug(inner_it=n_inner_iter, epochs=epochs)
log= run_dist_dataugV2(model=aug_model, epochs=epochs, inner_it=n_inner_iter, dataug_epoch_start=dataug_epoch_start, print_freq=1, loss_patience=None)
log= run_dist_dataugV2(model=aug_model, epochs=epochs, inner_it=n_inner_iter, dataug_epoch_start=dataug_epoch_start, print_freq=10, loss_patience=None)
####
print('-'*9)