Created
December 12, 2018 00:56
-
-
Save RodrigoCMoraes/f22c583120fe5098797184610bf981a5 to your computer and use it in GitHub Desktop.
This plot accuray and loss from history of training keras model
This file contains 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
# 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