-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: overfit_batches
uses same batch for train and val
#20731
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
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
…htning into overfit_batches_fix
overfit_batches
uses same batch for train and val
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Intuitively, we expect overfitting to occur when the model performs well on training set but not on validation. Using the same data for both training and validation essentially tell us only what happens on the training data. However, this is only half the story to properly assess whether overfitting occurs. @ved1beta Could you please elaborate more on the motivation behind using the same batches for both training and validation? |
Using the same batch for both training and validation with overfit_batches=1: -Tests a model's memorization capacity as a debugging technique |
Here's a commit message in the requested format for our changes:
What does this PR do?
This PR fixes the issue where
overfit_batches=1
uses different batches for training and validation. It ensures that the same batch is used for both training and validation steps when overfitting.Fixes #15021
Key Changes:
_resolve_overfit_batches
to use the same batch for both training and validationBefore submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--20731.org.readthedocs.build/en/20731/