Skip to content

Commit

Permalink
Added feature for saving checkpoint every certain epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
peterli3819 committed Dec 20, 2023
1 parent eaa27a1 commit 1c2e589
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hippynn/experiment/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,17 @@ def setup_and_train(
training_modules: TrainingModules,
database,
setup_params: SetupParams,
store_all_better=False,
store_best=True,
store_every=0
):
"""
:param: training_modules: see :func:`setup_training`
:param: database: see :func:`train_model`
:param: setup_params: see :func:`setup_training`
:param: store_all_better: Save the state dict for each model doing better than a previous one
:param: store_best: Save a checkpoint for the best model
:param: store_every: Save a checkpoint for every certain epochs
:return: See :func:`train_model`
Shortcut for setup_training followed by train_model.
Expand All @@ -134,6 +140,9 @@ def setup_and_train(
metric_tracker=metric_tracker,
callbacks=None,
batch_callbacks=None,
store_all_better=store_all_better,
store_best=store_best,
store_every=store_every
)


Expand Down

0 comments on commit 1c2e589

Please sign in to comment.