Skip to content

Commit

Permalink
Track validation F1 score of best model
Browse files Browse the repository at this point in the history
  • Loading branch information
Vansil authored Jun 13, 2019
1 parent e9ef3bd commit 8eed323
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ def main(args):
val_ppl, val_f1 = eval(val_data, model,
samples = args.mc_samples, count_eos_ppl = args.count_eos_ppl)
print('--------------------------------')
if val_f1 > best_val_f1:
best_val_f1 = val_f1
if val_ppl < best_val_ppl:
best_val_ppl = val_ppl
best_val_f1 = val_f1
checkpoint = {
'args': args.__dict__,
'model': model.cpu(),
Expand Down

0 comments on commit 8eed323

Please sign in to comment.