From c3da350960a8b0564a3a3fddc62c9a5d550b3c95 Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Tue, 18 Aug 2020 10:26:50 +0200
Subject: [PATCH] Fixed a bug: correct number of epochs is now displayed

---
 pysegcnn/core/graphics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py
index 3969d7f..c47893e 100644
--- a/pysegcnn/core/graphics.py
+++ b/pysegcnn/core/graphics.py
@@ -225,7 +225,7 @@ def plot_loss(state_file, figsize=(10, 10), step=5,
 
     # compute early stopping point
     if loss['va'].any():
-        esepoch = np.argmax(loss['va'].mean(axis=0)) * nbatches
+        esepoch = np.argmax(loss['va'].mean(axis=0)) * nbatches + 1
         esacc = np.max(loss['va'].mean(axis=0))
         ax1.vlines(esepoch, ymin=ax1.get_ylim()[0], ymax=ax1.get_ylim()[1],
                    ls='--', color='grey')
-- 
GitLab