Skip to content
Snippets Groups Projects
Commit df49f763 authored by Fabrice Daian's avatar Fabrice Daian
Browse files

update

parent a37ecacd
Branches
No related tags found
No related merge requests found
......@@ -190,7 +190,7 @@ def train(d_model, g_model, gan_model, dataset, output_path, val_dataset = None,
val_loss = mse/((ssim+1)/2) # scaling ssim on 0,1 instead of -1,1 : trouble when ssim is <0
with open(output_path+"/log.txt", 'a') as file:
# file.write("[Loss] Val loss at epoch %d : MSE[%.3e], SSIM[%.3e], Validation_Loss[%.3e]\n"%(current_epoch,mse,ssim,val_loss))
file.write("[Loss] Val loss at epoch ",str(current_epoch)," : MSE[",str(mse),"], SSIM[",str(ssim),"], Validation_Loss[",str(val_loss),"]\n")
file.write("[Loss] Val loss at epoch "+str(current_epoch)+" : MSE["+str(mse)+"], SSIM["+str(ssim)+"], Validation_Loss["+str(val_loss)+"]\n")
if val_loss < best_val_loss:
best_val_loss = np.copy(val_loss)
g_model.save(output_path+"/networks/Generator")
......@@ -214,7 +214,7 @@ def train(d_model, g_model, gan_model, dataset, output_path, val_dataset = None,
else :
with open(output_path+"/log.txt", 'a') as file:
# file.write("[Patience]: Reached at epoch %d with best validation loss :[%.3e]\n"%(current_epoch,val_loss))
file.write("[Patience]: Reached at epoch ",str(current_epoch),"with best validation loss :[",str(val_loss),"]\n")
file.write("[Patience]: Reached at epoch "+str(current_epoch)+"with best validation loss :["+str(val_loss)+"]\n")
break
gc.collect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment