Skip to content

Instantly share code, notes, and snippets.

@Rishit-dagli
Last active December 27, 2019 16:58
Show Gist options
  • Save Rishit-dagli/9fd816ba986e67827031df8ecc9bf6a1 to your computer and use it in GitHub Desktop.
Save Rishit-dagli/9fd816ba986e67827031df8ecc9bf6a1 to your computer and use it in GitHub Desktop.
class myCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs = {}):
if logs.get('loss') < 0.7:
print("\n Low loss so cancelling the training")
self.model.stop_training = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment