Skip to content

Instantly share code, notes, and snippets.

@bhachauk
Created April 28, 2020 11:48
Show Gist options
  • Save bhachauk/4fd9a06b5cf3f4b725fbdfab0556d3bb to your computer and use it in GitHub Desktop.
Save bhachauk/4fd9a06b5cf3f4b725fbdfab0556d3bb to your computer and use it in GitHub Desktop.
Stop training when the requirment done...
class myCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs.get('accuracy')>0.6):
print("\nReached 60% accuracy so cancelling training!")
self.model.stop_training = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment