def on_epoch_end(self, epoch, logs={}):
current = logs.get(self.monitor)
if self.monitor_op(current, self.best):
self.best = current
self.best_epoch = epoch
self.wait = 0
else:
if self.wait >= self.patience:
if self.verbose > 0:
print('Epoch %05d: early stopping' % (epoch))
self.model.stop_training = True
self.wait += 1
评论列表
文章目录