Skip to content

Commit

Permalink
Init _bestMetricValue for Loss metric (#5939)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroslavKabat authored Oct 5, 2021
1 parent 51c4984 commit 9cdd778
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Microsoft.ML.Vision/ImageClassificationTrainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ public EarlyStopping(float minDelta = 0.01f, int patience = 20, EarlyStoppingMet
if (metric == EarlyStoppingMetric.Accuracy)
CheckIncreasing = true;
else if (metric == EarlyStoppingMetric.Loss)
{
CheckIncreasing = false;
_bestMetricValue = Single.MaxValue;
}
}

/// <summary>
Expand Down

0 comments on commit 9cdd778

Please sign in to comment.