Skip to content

Commit

Permalink
Merge branch 'master' into sphinx-autosummary
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 authored Oct 20, 2020
2 parents d9c73da + 1b468e5 commit 87f3c42
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ignite/handlers/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,12 @@ def score_function(engine):
return engine.state.metrics['accuracy']
to_save = {'model': model}
handler = Checkpoint(to_save, DiskSaver('/tmp/models', create_dir=True), n_saved=2,
filename_prefix='best', score_function=score_function, score_name="val_acc",
global_step_transform=global_step_from_engine(trainer))
handler = Checkpoint(
to_save, DiskSaver('/tmp/models', create_dir=True),
n_saved=2, filename_prefix='best',
score_function=score_function, score_name="val_acc",
global_step_transform=global_step_from_engine(trainer)
)
evaluator.add_event_handler(Events.COMPLETED, handler)
Expand Down

0 comments on commit 87f3c42

Please sign in to comment.