class CustomEarlyStopping(Callback):

    def __init__(self, ratio=0.0, patience=0, verbose=0):
        super(EarlyStopping, self).__init__()
self.ratio = ratio
self.patience = patience
self.verbose = verbose
self.wait = 0
self.stopped_epoch = 0
self.monitor_op = np.greater

def on_train_begin(self, logs=None):
    pass
Обратный вызов Keras EarlyStopping, сравнивающий потери при обучении и проверке