DG: Add early stopping support to LightningModel#178
Merged
avantikalal merged 1 commit intomainfrom Mar 3, 2026
Merged
Conversation
Add early_stopping, patience, monitor, and mode to default_train_params and wire up an EarlyStopping callback in train_on_dataset when enabled. Co-authored-by: Ona <no-reply@ona.com>
Collaborator
Author
|
On this same front, any thought for about adding |
avantikalal
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
train_paramsacceptsearly_stopping,patience,monitor, andmodekeys but they were never wired up. This PR connects them to apytorch_lightning.callbacks.EarlyStoppingcallback intrain_on_dataset.Changes in
src/grelu/lightning/__init__.py:EarlyStoppingfrompytorch_lightning.callbacksearly_stopping,patience,monitor, andmodetodefault_train_params(disabled by default)EarlyStoppingcallback intrain_on_datasetwhenearly_stoppingisTrueRelated Issue(s)
N/A
How to test
Pass early stopping params in
train_paramsand verify training stops when the monitored metric plateaus: