Skip to content

Instantly share code, notes, and snippets.

@RodrigoCMoraes
Created December 12, 2018 00:56
Show Gist options
  • Save RodrigoCMoraes/f22c583120fe5098797184610bf981a5 to your computer and use it in GitHub Desktop.
Save RodrigoCMoraes/f22c583120fe5098797184610bf981a5 to your computer and use it in GitHub Desktop.
This plot accuray and loss from history of training keras model
# batch_size = 1024
# num_epochs = 20
# history = model.fit(X_train, train_labels,
# batch_size=batch_size,
# epochs=num_epochs,
# validation_data=(X_val, val_labels))
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()
# summarize history for loss
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment