Commit 9a8f3121 authored by Davis King's avatar Davis King

Made the loss dumping between learning rate changes a little more relaxed. In

particular, rather than just dumping exactly 400 of the last loss values, it
now dumps 400 + 10% of the loss buffer.  This way, the amount of the dump is
proportional to the steps without progress threshold.  This is better because
when the user sets the steps without progress to something larger it probably
means you need to look at more loss values to determine that we should stop,
so dumping more in that case ought to be better.
parent 2b8becae
...@@ -705,7 +705,7 @@ namespace dlib ...@@ -705,7 +705,7 @@ namespace dlib
test_steps_without_progress = 0; test_steps_without_progress = 0;
// Empty out some of the previous loss values so that test_steps_without_progress // Empty out some of the previous loss values so that test_steps_without_progress
// will decrease below test_iter_without_progress_thresh. // will decrease below test_iter_without_progress_thresh.
for (int cnt = 0; cnt < test_previous_loss_values_dump_amount && test_previous_loss_values.size() > 0; ++cnt) for (int cnt = 0; cnt < test_previous_loss_values_dump_amount+test_iter_without_progress_thresh/10 && test_previous_loss_values.size() > 0; ++cnt)
test_previous_loss_values.pop_front(); test_previous_loss_values.pop_front();
} }
} }
...@@ -825,7 +825,7 @@ namespace dlib ...@@ -825,7 +825,7 @@ namespace dlib
steps_without_progress = 0; steps_without_progress = 0;
// Empty out some of the previous loss values so that steps_without_progress // Empty out some of the previous loss values so that steps_without_progress
// will decrease below iter_without_progress_thresh. // will decrease below iter_without_progress_thresh.
for (int cnt = 0; cnt < previous_loss_values_dump_amount && previous_loss_values.size() > 0; ++cnt) for (int cnt = 0; cnt < previous_loss_values_dump_amount+iter_without_progress_thresh/10 && previous_loss_values.size() > 0; ++cnt)
previous_loss_values.pop_front(); previous_loss_values.pop_front();
} }
} }
......
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