/mc4.py Secret
Created
October 11, 2020 06:54
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
model.compile(loss = 'categorical_crossentropy', | |
optimizer = 'adam', | |
metrics = ['accuracy']) | |
class myCallback(tf.keras.callbacks.Callback): | |
def on_epoch_end(self, epoch, logs={}): | |
if(logs.get('accuracy')>0.95): | |
print("\nReached >95% accuracy so cancelling 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