Skip to content

Instantly share code, notes, and snippets.

@kukumber
Last active April 28, 2019 19:57
Show Gist options
  • Save kukumber/0df987d76d759666325cece077f133cb to your computer and use it in GitHub Desktop.
Save kukumber/0df987d76d759666325cece077f133cb to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
acc = history.history['acc']
val_acc = history.history['val_acc']
loss = history.history['loss']
val_loss = history.history['val_loss']
epochs = range(len(acc))
fig, (ax1, ax2) = plt.subplots(2, 1)
fig.set_figwidth(12)
fig.set_figheight(10)
ax1.plot(epochs, acc, 'r', label="Training Accuracy")
ax1.plot(epochs, val_acc, 'b', label="Validation Accuracy")
ax1.set_title("Training and validation accuracy")
ax1.legend()
ax1.grid()
ax2.plot(epochs, loss, 'r', label="Training Loss")
ax2.plot(epochs, val_loss, 'b', label="Validation Loss")
ax2.set_title("Training and validation loss")
ax2.legend()
ax2.grid()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment