Skip to content

Instantly share code, notes, and snippets.

@gpolyn
Last active March 16, 2022 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpolyn/3e79d02ea222520757e108e149d8e970 to your computer and use it in GitHub Desktop.
Save gpolyn/3e79d02ea222520757e108e149d8e970 to your computer and use it in GitHub Desktop.
def plot_loss(history: keras.callbacks.History, xlabel: str = None, ylabel: str = None, ylim: list = None):
  plt.plot(history.history['loss'], label='loss')
  plt.plot(history.history['val_loss'], label='val_loss')
  plt.ylim(ylim)
  plt.xlabel(xlabel)
  plt.ylabel(ylabel)
  plt.legend()
  plt.grid(True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment