Skip to content

Instantly share code, notes, and snippets.

@Tusharsharma118
Created October 21, 2019 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tusharsharma118/a1ce3501234f6e9a4f6dfd6d08853129 to your computer and use it in GitHub Desktop.
Save Tusharsharma118/a1ce3501234f6e9a4f6dfd6d08853129 to your computer and use it in GitHub Desktop.
Early Stopping Callback
monitor = tf.keras.callbacks.EarlyStopping(monitor = 'val_loss',patience = 8,restore_best_weights = True, min_delta = 0.01)
# Using the Callback
history = model_regularized.fit_generator(train_generator, validation_data=validation_generator,steps_per_epoch=(len(train_split_images) / 32),epochs = 52,verbose=1,callbacks=[monitor])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment