Last active
October 15, 2020 20:35
-
-
Save esmitt/ca4ad82546d48c6305452321a9124f22 to your computer and use it in GitHub Desktop.
Early stopping callback in Tensorflow 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.keras.callbacks import EarlyStopping | |
""" | |
This callback will stop the training when there is no improvement in the validation accuracy across epochs | |
""" | |
early_callback = EarlyStopping(monitor='val_auc', | |
verbose=1, | |
patience=10, | |
mode='max', | |
restore_best_weights=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment