I adjusted the EarlyStopping
callback to instead run for all your epochs and then report back when your highest value was and what it was during training:
class TrackHighestEpoch(TrackerCallback):
"A `TrackerCallback` that monitors training for improvements and reports back at the end"
def __init__(self, monitor='accuracy', comp=None, min_delta=0., patience=1):
super().__init__(monitor=monitor, comp=comp, min_delta=min_delta)
self.patience = patience
def begin_fit(self): self.highest_epoch = 0; super().begin_fit()
def after_epoch(self):
"Compare the value monitored to its best score and maybe stop training."
super().after_epoch()
if self.new_best:
self.highest_epoch = self.epoch
def after_fit(self):
"Print highest value"
print(f'Highest accuracy of: {self.best} at epoch {self.highest_epoch+1}')