-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Support val_check_interval values higher than number of training batches #11993
Support val_check_interval values higher than number of training batches #11993
Conversation
It seems that the only tests which are failing are due to |
for more information, see https://pre-commit.ci
…erval # Conflicts: # CHANGELOG.md # pytorch_lightning/callbacks/progress/base.py # pytorch_lightning/loops/epoch/training_epoch_loop.py # pytorch_lightning/trainer/connectors/data_connector.py # pytorch_lightning/trainer/trainer.py
…_val_check_interval # Conflicts: # pytorch_lightning/trainer/trainer.py
I've updated the PR so that merge conflicts with changes from the 1.6 release are resolved. Hopefully, the PR won't go stale again :) |
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.
Good job on the PR!
I've resolved your comments, and also added a test case for an iterable dataset without a defined length. |
use more sensible value to approx inf
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.
Great work @nikvaessen !! 🚀
What does this PR do?
Fixes #8135
Fixes #4406
Fixes #5413.
It enables using
val_check_interval
with a value higher than the amount of batches in one training data loader iteration. This is very useful when you use a cyclic learning rate, and want to validate on the extreme values of a cycle, without having to worry about the amount of samples in your dataset.I chose to implement the following option as provided by @carmocca in #8135 (comment)
Does your PR introduce any breaking changes? If yes, please list them.
I'm not sure as I'm not very familiar with the code base. Some people might rely on the fact that
val_check_interval
does not cause a validation loop to happen when the value is higher than the amount of training batches, but I doubt it as I don't see a reason for intentionally skipping a validation epoch.Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃