Commit e4998c13 authored by Juha Reunanen's avatar Juha Reunanen Committed by Davis E. King
Browse files

Add sanity check (#1964)

parent b817bc1e
...@@ -1113,6 +1113,10 @@ namespace dlib ...@@ -1113,6 +1113,10 @@ namespace dlib
if (gradient_updates_since_last_sync < 30) if (gradient_updates_since_last_sync < 30)
return false; return false;
// if learning rate was changed from outside during training, for example
if (g.current_n() <= 2)
return false;
// if the loss is very likely to be increasing then return true // if the loss is very likely to be increasing then return true
const double prob = g.probability_gradient_greater_than(0); const double prob = g.probability_gradient_greater_than(0);
if (prob > prob_loss_increasing_thresh) if (prob > prob_loss_increasing_thresh)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment