mirror of https://github.com/davisking/dlib.git
Make sure the test loss the trainer logs to the console never gets suck at
infinity.
This commit is contained in:
parent
261f12d4ea
commit
04a8f0093d
|
@ -584,7 +584,8 @@ namespace dlib
|
||||||
void record_test_loss(double loss)
|
void record_test_loss(double loss)
|
||||||
{
|
{
|
||||||
test_previous_loss_values.push_back(loss);
|
test_previous_loss_values.push_back(loss);
|
||||||
rs_test.add(loss);
|
if (is_finite(loss))
|
||||||
|
rs_test.add(loss);
|
||||||
// discard really old loss values.
|
// discard really old loss values.
|
||||||
while (test_previous_loss_values.size() > test_iter_without_progress_thresh)
|
while (test_previous_loss_values.size() > test_iter_without_progress_thresh)
|
||||||
test_previous_loss_values.pop_front();
|
test_previous_loss_values.pop_front();
|
||||||
|
|
Loading…
Reference in New Issue