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

Smart handling of EarlyStopping.check_on_train_epoch_end #8888

Merged
merged 3 commits into from
Aug 14, 2021

Conversation

carmocca
Copy link
Contributor

@carmocca carmocca commented Aug 13, 2021

What does this PR do?

When val_check_interval != 1.0, it's likely that early stopping should run after validation.

Same check as:

https://github.com/PyTorchLightning/pytorch-lightning/blob/5b143d02649c043ab7a7d0b444a42122f54f08d4/pytorch_lightning/callbacks/model_checkpoint.py#L251-L259

Could be considered a bugfix instead of a feature. Should it go into 1.4.x?

Reported in Slack: https://pytorch-lightning.slack.com/archives/CRBLFHY79/p1628241599256200

Does your PR introduce any breaking changes? If yes, please list them.

None

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • [n/a] Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

@carmocca carmocca added the feature Is an improvement or enhancement label Aug 13, 2021
@carmocca carmocca self-assigned this Aug 13, 2021
@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #8888 (edbceb2) into master (5b143d0) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #8888   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         169     169           
  Lines       14079   14082    +3     
======================================
+ Hits        13053   13058    +5     
+ Misses       1026    1024    -2     

Copy link
Member

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe not 1.4.x, because check_on_train_epoch_end was True so it seems this behavior was well defined.

@mergify mergify bot added the ready PRs ready to be merged label Aug 13, 2021
@carmocca carmocca added this to the v1.5 milestone Aug 14, 2021
@Borda Borda merged commit bfeffde into master Aug 14, 2021
@Borda Borda deleted the feat/es-check_on_train_epoch_end branch August 14, 2021 06:50
four4fish pushed a commit to four4fish/pytorch-lightning that referenced this pull request Aug 16, 2021
…-AI#8888)

* Smart handling of `EarlyStopping.check_on_train_epoch_end`

* dummy value

* Extra flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants