Skip to content

Commit 9cdd778

Browse files
Init _bestMetricValue for Loss metric (dotnet#5939)
1 parent 51c4984 commit 9cdd778

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Microsoft.ML.Vision/ImageClassificationTrainer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ public EarlyStopping(float minDelta = 0.01f, int patience = 20, EarlyStoppingMet
258258
if (metric == EarlyStoppingMetric.Accuracy)
259259
CheckIncreasing = true;
260260
else if (metric == EarlyStoppingMetric.Loss)
261+
{
261262
CheckIncreasing = false;
263+
_bestMetricValue = Single.MaxValue;
264+
}
262265
}
263266

264267
/// <summary>

0 commit comments

Comments
 (0)