We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was working on a fix for #524 and found that early stopping starts to kick in at epoch 3 despite min_epochs = 1.
run basic_examples/gpu_template.py and log the callback calls every epoch.
When setting min_epochs=n (counting from 1), we should evaluate early stopping at the end of epoch n.
I propose to change this line in the training loop: met_min_epochs = epoch > self.min_epochs to met_min_epochs = epoch >= self.min_epochs - 1
met_min_epochs = epoch > self.min_epochs
met_min_epochs = epoch >= self.min_epochs - 1
Why the "-1"? The epoch variable in the training loop starts at 0, but the Trainer argument min_epochs starts counting at 1.
epoch
min_epochs
Why the ">="? The early stop check is done at the end of each epoch, hence the epoch counter will be = to min_epochs after min_epochs have passed.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
submit the PR for this?
Sorry, something went wrong.
yep. was waiting for an approval.
Successfully merging a pull request may close this issue.
Describe the bug
I was working on a fix for #524 and found that early stopping starts to kick in at epoch 3 despite min_epochs = 1.
To Reproduce
run basic_examples/gpu_template.py and log the callback calls every epoch.
Expected behavior
When setting min_epochs=n (counting from 1), we should evaluate early stopping at the end of epoch n.
Proposed fix:
I propose to change this line in the training loop:
met_min_epochs = epoch > self.min_epochs
to
met_min_epochs = epoch >= self.min_epochs - 1
Why the "-1"? The
epoch
variable in the training loop starts at 0, but the Trainer argumentmin_epochs
starts counting at 1.Why the ">="? The early stop check is done at the end of each epoch, hence the
epoch
counter will be = tomin_epochs
aftermin_epochs
have passed.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: