F1 par classes + plot OK

This commit is contained in:
Harle, Antoine (Contracteur) 2020-02-03 11:21:54 -05:00
parent 3ccacd0366
commit fcd0217d54
5 changed files with 57 additions and 22 deletions

View file

@ -4,7 +4,7 @@ if __name__ == "__main__":
#'''
files=[
"res/log/Aug_mod(Data_augV5(Mix0.8-23TFx4-Mag)-LeNet)-100 epochs (dataug:0)- 1 in_it.json",
"../res/log/Aug_mod(Data_augV5(Mix0.8-3TFx2-MagFx)-resnet18)-2 epochs (dataug:0)- 1 in_it.json",
#"res/brutus-tests/log/Aug_mod(Data_augV5(Uniform-14TFx3-MagFxSh)-LeNet)-150epochs(dataug:0)-10in_it-0.json",
#"res/brutus-tests/log/Aug_mod(Data_augV5(Uniform-14TFx3-MagFxSh)-LeNet)-150epochs(dataug:0)-10in_it-1.json",
#"res/brutus-tests/log/Aug_mod(Data_augV5(Uniform-14TFx3-MagFxSh)-LeNet)-150epochs(dataug:0)-10in_it-2.json",
@ -15,7 +15,7 @@ if __name__ == "__main__":
#legend+=str(idx)+'-'+file+'\n'
with open(file) as json_file:
data = json.load(json_file)
plot_resV2(data['Log'], fig_name=file.replace('.json','').replace('log/',''), param_names=data['Param_names'])
plot_resV2(data['Log'], fig_name=file.replace("/log","").replace(".json",""), param_names=data['Param_names'])
#plot_TF_influence(data['Log'], param_names=data['Param_names'])
#'''
## Loss , Acc, Proba = f(epoch) ##
@ -92,4 +92,29 @@ if __name__ == "__main__":
print(idx, data['Accuracy'])
print(files[0], np.mean(accs), np.std(accs), np.mean(times))
'''
'''
inner_its = [1]
dist_mix = [0]#[0.5, 0.8, 1.0] #Uniform
N_seq_TF= [4, 3, 2]
nb_run= 3
for n_inner_iter in inner_its:
for n_tf in N_seq_TF:
for dist in dist_mix:
#files = ["../res/brutus-tests2/log/Aug_mod(Data_augV5(Mix%.1f-14TFx%d-MagFxSh)-ResNet18)-150 epochs (dataug:0)- 1 in_it-%s.json"%(dist, n_tf, str(run)) for run in range(nb_run)]
files = ["../res/brutus-tests2/log/Aug_mod(Data_augV5(Uniform-14TFx%d-MagFxSh)-ResNet18)-150 epochs (dataug:0)- 1 in_it-%s.json"%(n_tf, str(run)) for run in range(nb_run)]
accs = []
times = []
for idx, file in enumerate(files):
#legend+=str(idx)+'-'+file+'\n'
with open(file) as json_file:
data = json.load(json_file)
accs.append(data['Accuracy'])
times.append(data['Time'][0])
print(idx, data['Accuracy'])
print(files[0], 'acc', np.mean(accs), '+-',np.std(accs), ',t', np.mean(times))
'''