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

RFC: Add early stopping for all LR schedulers based on validation score improvements #218

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mcognetta
Copy link
Contributor

@mcognetta mcognetta commented Sep 15, 2023

This is an example implementation to address #215 , which allows early stopping based on validation metric improvements regardless of the learning rate scheduler used. Prior to this, only the plateau scheduler could trigger early stopping, and that was based on it reducing the learning rate of the optimizer to below the min_lr setting. This change allows for specifying a threshold of successive validation runs, which if no improvement on the validation score is observed, ends training early.

An example training config is also included (configs/iwslt14_deen_bpe_early_stopping.yaml).

Note: I manually copied this from a personal fork that has a number of other changes, so I haven't been able to fully test it yet.

@may-
Copy link
Collaborator

may- commented Sep 16, 2023

Awesome!

Should we maybe save the value of self.stats.validation_steps_since_last_improvement in the state_dict to make it resumable, when someone want to continue training from a saved ckpt? just like self.stats.best_ckpt_score?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants