Skip to content
Snippets Groups Projects
Unverified Commit 133b7c96 authored by Eric Schanet's avatar Eric Schanet
Browse files

Same color for test and validation loss function

parent b4048320
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ def overlay_ROC(filename, *projects): ...@@ -21,7 +21,7 @@ def overlay_ROC(filename, *projects):
fpr, tpr, threshold = roc_curve(p.y_test, p.scores_test, sample_weight = p.w_test) fpr, tpr, threshold = roc_curve(p.y_test, p.scores_test, sample_weight = p.w_test)
fpr = 1.0 - fpr fpr = 1.0 - fpr
roc_auc = auc(tpr, fpr) roc_auc = auc(tpr, fpr)
plt.grid(color='gray', linestyle='--', linewidth=1) plt.grid(color='gray', linestyle='--', linewidth=1)
plt.plot(tpr, fpr, label=str(p.name+" (AUC = {})".format(roc_auc))) plt.plot(tpr, fpr, label=str(p.name+" (AUC = {})".format(roc_auc)))
...@@ -41,9 +41,13 @@ def overlay_loss(filename, *projects): ...@@ -41,9 +41,13 @@ def overlay_loss(filename, *projects):
logger.info("Overlay loss curves for {}".format([p.name for p in projects])) logger.info("Overlay loss curves for {}".format([p.name for p in projects]))
for p in projects: prop_cycle = plt.rcParams['axes.prop_cycle']
plt.semilogy(p.history.history['loss'], linestyle='--', label="Training Loss "+p.name) colors = prop_cycle.by_key()['color']
plt.semilogy(p.history.history['val_loss'], label="Validation Loss "+p.name)
for p,color in zip(projects,colors):
plt.semilogy(p.history.history['loss'], linestyle='--', label="Training Loss "+p.name, color=color)
plt.semilogy(p.history.history['val_loss'], label="Validation Loss "+p.name, color=color)
plt.ylabel('loss') plt.ylabel('loss')
plt.xlabel('epoch') plt.xlabel('epoch')
plt.legend(loc='upper right') plt.legend(loc='upper right')
......
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