Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvements / bug fixes #476

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Only save best model based on validation loss
mitchelldehaven committed Apr 23, 2024
commit d8655a19ca18a5a08106e225db01d7bbcc8f3f6b
2 changes: 1 addition & 1 deletion src/python/piper_train/__main__.py
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ def main():

callbacks = []
if args.checkpoint_epochs is not None:
callbacks.append(ModelCheckpoint(every_n_epochs=args.checkpoint_epochs))
callbacks.append(ModelCheckpoint(every_n_epochs=args.checkpoint_epochs, monitor="val_loss", save_top_k=1, mode="min"))
_LOGGER.debug(
"Checkpoints will be saved every %s epoch(s)", args.checkpoint_epochs
)