Skip to content

Instantly share code, notes, and snippets.

@none53
Last active November 12, 2018 21:54
Show Gist options
  • Select an option

  • Save none53/b76dd264b3f1c22e29986182bf5f3262 to your computer and use it in GitHub Desktop.

Select an option

Save none53/b76dd264b3f1c22e29986182bf5f3262 to your computer and use it in GitHub Desktop.
Layout Graph
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 = plt.figure(figsize=(10, 5))
fig.add_subplot(1, 2, 1)
plt.plot(epochs, acc, 'bo', label='Training acc')
plt.plot(epochs, val_acc, 'b', label='Validation acc')
plt.title('Training and Validation acc')
plt.legend()
epochs = range(len(loss))
fig.add_subplot(1, 2, 2)
plt.plot(epochs, loss, 'bo', label='Training loss')
plt.plot(epochs, val_loss, 'b', label='Validation loss')
plt.title('Training and Validation loss')
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment