From 3d4bd975e6a34cd22baacca6e69ccb6d52047515 Mon Sep 17 00:00:00 2001 From: Davis King Date: Tue, 19 Sep 2017 06:29:49 -0400 Subject: [PATCH] Made unit test more robust --- dlib/test/ranking.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlib/test/ranking.cpp b/dlib/test/ranking.cpp index d504fb479..83f70d8cc 100644 --- a/dlib/test/ranking.cpp +++ b/dlib/test/ranking.cpp @@ -434,7 +434,7 @@ namespace x.push_back(matrix_cast(data.nonrelevant[0])); y.push_back(-1); //trainer.be_verbose(); - trainer.set_learning_rate_schedule(logspace(-1, -7, 2000)); + trainer.set_learning_rate_schedule(logspace(-1, -7, 4000)); trainer.train(x,y); matrix params = mat(net.subnet().layer_details().get_layer_params()); @@ -442,8 +442,8 @@ namespace dlog << LINFO << "relevant output score: " << net(x[0]); dlog << LINFO << "nonrelevant output score: " << net(x[1]); - DLIB_TEST(std::abs(params(0) - 1) < 0.0001); - DLIB_TEST(std::abs(params(1) + 1) < 0.0001); + DLIB_TEST(std::abs(params(0) - 1) < 0.001); + DLIB_TEST(std::abs(params(1) + 1) < 0.001); DLIB_TEST(std::abs(net(x[0]) - 1) < 0.001); DLIB_TEST(std::abs(net(x[1]) + 1) < 0.001); }