Skip to content

Instantly share code, notes, and snippets.

@joelthchao
Last active July 2, 2017 15:54
Show Gist options
  • Save joelthchao/72aa0477cced54b09024a602b87ca4c6 to your computer and use it in GitHub Desktop.
Save joelthchao/72aa0477cced54b09024a602b87ca4c6 to your computer and use it in GitHub Desktop.
Keras Callback
log_file = 'path/to/log.txt' # if you don't want to do logging, just leave the kwags unfilled
my_callback = MyCallback(test_x, test_y, log_file=log_file, verbose=True)
model.fit(train_x, train_y, callbacks=[my_callback])
"""
Output:
59264/60000 [============================>.] - ETA: 0s - loss: 0.3520 - acc: 0.8925Epoch 0 acc= 0.9753
60000/60000 [==============================] - 5s - loss: 0.3497 - acc: 0.8932 - val_loss: 0.0818 - val_acc: 0.9753
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment