Early Stopping kicks in at min_epochs + 2 instead of min_epochs
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 argument min_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 = to min_epochs after min_epochs have passed.


Desktop (please complete the following information):

OS: Linux
Version: master