early-stopping-pytorch
early-stopping-pytorch copied to clipboard
Update: EarlyStop condition with default delta
Do you think the early stopping condition check in line number 36 in __cal__() function of EarlyStopping class should be less than or equal to instead of just less than?
The logic behind this is:
When we go with the default values, the delta is 0 this means the early stopping condition check defaults to:
score < self.best_score
Now consider the case when the score is not improving and it is constant throughout the epochs. In this case, the score will never be less than the best_score. Hence, this will not early stop.
In order to incorporate this case i.e. when score is not improving and is constant throughout the epochs, the EarlyStopping counter should start, and it should terminate eventually after we run out of patience.
Hence, the early stop condition check should change from:
elif score < self.best_score + self.delta:
to,
elif score <= self.best_score + self.delta: