Commit 97a6b139 authored by Sergey Edunov's avatar Sergey Edunov Committed by Myle Ott
Browse files

Reset gnorm after each epoch

parent ef43da72
Loading
Loading
Loading
Loading
+1 −1
Changes for train.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ def train(args, trainer, task, epoch_itr):
    progress.print(stats)

    # reset training meters
    for k in ['train_loss', 'train_nll_loss', 'wps', 'ups', 'wpb', 'bsz', 'clip']:
    for k in ['train_loss', 'train_nll_loss', 'wps', 'ups', 'wpb', 'bsz', 'clip', 'gnorm']:
        meter = trainer.get_meter(k)
        if meter is not None:
            meter.reset()