Skip to content

Commit

Permalink
Merge pull request #10 from Helsinki-NLP/fix/early-stop
Browse files Browse the repository at this point in the history
plugging back early stopper
  • Loading branch information
TimotheeMickus authored Sep 25, 2023
2 parents ee91f21 + c72611b commit 3b1678e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions onmt/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ def train(
valid_stats=valid_stats,
)

# # Run patience mechanism
# if self.earlystopper is not None:
# self.earlystopper(valid_stats, step)
# # If the patience has reached the limit, stop training
# if self.earlystopper.has_stopped():
# break
# Run patience mechanism
if self.earlystopper is not None:
self.earlystopper(valid_stats, step)
# If the patience has reached the limit, stop training
if self.earlystopper.has_stopped():
break

if self.model_saver is not None and (save_checkpoint_steps != 0 and step % save_checkpoint_steps == 0):
self.model_saver.save(step, moving_average=self.moving_average)
Expand Down

0 comments on commit 3b1678e

Please sign in to comment.