From my observations it seems that we cannot use the same instance of EarlyStopping callback when training multiple models. My assumption is that it saves the best value from one training and uses it to compare during the training of the next model.
In on_train_begin we have comment "# Allow instances to be re-used", however the value self.best is not cleared. I think it should be reinitialized with self.best = (float("inf") if self.monitor_op == ops.less else -float("inf")) as in __init__().
From my observations it seems that we cannot use the same instance of EarlyStopping callback when training multiple models. My assumption is that it saves the best value from one training and uses it to compare during the training of the next model.
In
on_train_begin
we have comment "# Allow instances to be re-used", however the valueself.best
is not cleared. I think it should be reinitialized withself.best = (float("inf") if self.monitor_op == ops.less else -float("inf"))
as in__init__()
.