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

Early stopping #453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Early stopping #453

wants to merge 1 commit into from

Conversation

derekehyatt
Copy link

Stop early if the validation loss does not improve in early_stopping_iters (default: off).

@derekehyatt
Copy link
Author

@karpathy - would love a review for this simple early stopping flag. Thanks!

@dimentox
Copy link

dimentox commented Sep 7, 2024

Observations:
Correct Implementation: The implementation looks correct in terms of functionality. It allows the training to stop early when there is no improvement in validation loss, saving computational resources.
Patience Logic: The patience logic is clear and straightforward. It resets patience to 0 when there’s an improvement in validation loss and increments it otherwise.
Mutual Exclusivity Check: The script correctly checks that early_stopping_iters and always_save_checkpoint are not used together.
Possible Improvements:
Log More Information on Early Stopping: When early stopping is triggered, it might be helpful to log not just the number of patience iterations but also the final best validation loss and step number.

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.

2 participants