How can I interrupt training when the validation loss isn’t decreasing anymore?

You can use an EarlyStopping callback:

from keras.callbacks import EarlyStopping

early_stopping = EarlyStopping(monitor='val_loss', patience=2)
model.fit(x, y, validation_split=0.2, callbacks=[early_stopping])

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *