Modification test pour simplifier early stopping

This commit is contained in:
Harle, Antoine (Contracteur) 2019-11-13 13:38:00 -05:00
parent 198fb06065
commit f0c0559e73
4 changed files with 49 additions and 29 deletions

View file

@ -65,6 +65,7 @@ if __name__ == "__main__":
'''
#### Augmented Model ####
#'''
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_augV4(TF_dict=tf_dict, N_TF=2, mix_dist=0.0), LeNet(3,10)).to(device)
@ -77,10 +78,12 @@ if __name__ == "__main__":
print('-'*9)
times = [x["time"] for x in log]
out = {"Accuracy": max([x["acc"] for x in log]), "Time": (np.mean(times),np.std(times)), "Device": device_name, "Param_names": aug_model.TF_names(), "Log": log}
print(str(aug_model),": acc", out["Accuracy"], "in (ms):", out["Time"][0], "+/-", out["Time"][1])
print(str(aug_model),": acc", out["Accuracy"], "in (s ?):", out["Time"][0], "+/-", out["Time"][1])
with open("res/log/%s.json" % "{}-{} epochs (dataug:{})- {} in_it".format(str(aug_model),epochs,dataug_epoch_start,n_inner_iter), "w+") as f:
json.dump(out, f, indent=True)
print('Log :\"',f.name, '\" saved !')
print('Execution Time : %.00f (s ?)'%(time.process_time() - t0))
print('-'*9)
#'''
#### TF number tests ####