Created
April 28, 2020 11:48
-
-
Save bhachauk/4fd9a06b5cf3f4b725fbdfab0556d3bb to your computer and use it in GitHub Desktop.
Stop training when the requirment done...
This file contains hidden or 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
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