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

Removing unecessary early stopping calls #1863

Merged

Conversation

elkotito
Copy link
Contributor

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #1751

PR review

The removed early stopping calls are conditioned in different cases.

  • The first one is called right after the validation dataset evaluation.
  • The second one is in case of no validation dataset i.e. no validation_step implemented.

It's enough to call it once after the training because self.early_stop_callback.on_epoch_end can read required metrics from trainer.callback_metrics.

@mergify mergify bot requested a review from a team May 17, 2020 14:56
@elkotito elkotito marked this pull request as ready for review May 17, 2020 19:55
@williamFalcon
Copy link
Contributor

i think there was a reason for both of those. need to think about this more

@Borda Borda added the feature Is an improvement or enhancement label May 20, 2020
@mergify mergify bot requested a review from a team May 22, 2020 00:50
@jeremyjordan
Copy link
Contributor

@williamFalcon Directly calling the callback methods (eg. on_epoch_end) is an anti-pattern, we should delegate that responsibility to the callback handler. When a user is writing callback code for on_epoch_end they should be able to trust that it will only be called at the end of an epoch.

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.

It looks like this also fixes an issue with "patience".
If so I would also list it in the changelog that patience is fixed.

@mergify mergify bot requested a review from a team May 22, 2020 06:31
@mergify
Copy link
Contributor

mergify bot commented May 22, 2020

This pull request is now in conflict... :(

@Borda Borda force-pushed the bugfix/1751_earlystopping branch from 44648b3 to 4fd7cab Compare May 22, 2020 13:50
@Borda Borda added the ready PRs ready to be merged label May 22, 2020
@codecov
Copy link

codecov bot commented May 22, 2020

Codecov Report

Merging #1863 into master will decrease coverage by 0%.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #1863   +/-   ##
======================================
- Coverage      88%     88%   -0%     
======================================
  Files          74      74           
  Lines        4650    4645    -5     
======================================
- Hits         4070    4065    -5     
  Misses        580     580           

@mergify
Copy link
Contributor

mergify bot commented May 25, 2020

This pull request is now in conflict... :(

@mergify
Copy link
Contributor

mergify bot commented May 25, 2020

This pull request is now in conflict... :(

@williamFalcon williamFalcon merged commit 3af4994 into Lightning-AI:master May 26, 2020
justusschock pushed a commit that referenced this pull request Jun 29, 2020
* Removing unecessary early stopping calls

* Update CHANGELOG.md

Co-authored-by: Mateusz Pieniak <mateusz.pieniak@evidenceprime.com>
Co-authored-by: William Falcon <waf2107@columbia.edu>
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.

Early Stopping behavior
5 participants