Skip to content
Snippets Groups Projects
Commit 98e67409 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Improved plotting for loss.

parent ebd09ef3
No related branches found
No related tags found
No related merge requests found
......@@ -166,9 +166,8 @@ def plot_loss(state_file, figsize=(10, 10), step=5, palette='mako'):
# plot training and validation loss
colors = sns.color_palette(palette, n_colors=2)
for (k, v), ls, c, marker, ax in zip(rm.items(), ['-', '--'], colors,
markers, axes):
ax.plot(v, 'o', ls=ls, color=c, markevery=marker)
for (k, v), c, marker, ax in zip(rm.items(), colors, markers, axes):
ax.plot(v, 'o', color=c, markevery=marker)
# x axis limits
axes[0].set_xticks(np.arange(0, ntbatches * (epochs[-1] + 1),
......@@ -199,8 +198,8 @@ def plot_loss(state_file, figsize=(10, 10), step=5, palette='mako'):
# create a patch (proxy artist) for every color
ulabels = ['Training', 'Validation']
patches = [mlines.Line2D([], [], color=c, ls=ls, label=l) for c, ls, l in
zip(colors, ['-', '--'], ulabels)]
patches = [mlines.Line2D([], [], color=c, label=l) for c, l in
zip(colors, ulabels)]
# plot patches as legend
ax.legend(handles=patches, loc='upper left', frameon=False, ncol=2,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment