def METHOD_NAME(self):
    patience = 3
    data = np.random.random((100, 1))
    labels = np.where(data > 0.5, 1, 0)
    model = models.Sequential(
        (
            layers.Dense(1, activation="relu"),
            layers.Dense(1, activation="relu"),
        )
    )
    model.compile(
        optimizer="sgd",
        loss="mae",
        metrics=["mse"],
    )
    weights = model.get_weights()
    # This should allow training to go for at least `patience` epochs
    model.set_weights(weights)
    stopper = callbacks.EarlyStopping(monitor="mse", patience=patience)
    hist = model.fit(
        data, labels, callbacks=[stopper], verbose=0, epochs=20
    )
    assert len(hist.epoch) >= patience