-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add early stopping #767
Add early stopping #767
Conversation
Codecov Report
@@ Coverage Diff @@
## master #767 +/- ##
==========================================
+ Coverage 88.75% 88.90% +0.15%
==========================================
Files 14 14
Lines 1254 1271 +17
==========================================
+ Hits 1113 1130 +17
Misses 141 141
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! If it's straightforward to add a test for early stopping, that'd be great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Add option to stop training early if validation loss hasn't decreased for a set number of epochs. This is configurable using the
enable_early_stopping
andpatience
flags inconfig.trainer
.I removed the
min_epochs
flag from trainer because that overrides early stopping. I also suppressed a pylint warning for too-many-statements intrain
- we should maybe consider factoring some of the stuff that isn't directly related to training, like loading best weights, into a separate function.