Skip to content

Instantly share code, notes, and snippets.

@nitin-bommi
Created July 15, 2020 11:57
Show Gist options
  • Save nitin-bommi/42df63616590d77dbb3efb0845804fbb to your computer and use it in GitHub Desktop.
Save nitin-bommi/42df63616590d77dbb3efb0845804fbb to your computer and use it in GitHub Desktop.
class myCallBack(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs['accuracy']>0.99):
print("\n\nAccuracy greater than 99%. Stopping the training")
self.model.stop_training = True
callbacks = myCallBack()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment