Commit c1443d4d authored by Davis King's avatar Davis King

Added some tests to make sure that both the ekm and lisf objects

measure projection error the same way.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403683
parent 3e9a0d42
...@@ -270,6 +270,19 @@ namespace ...@@ -270,6 +270,19 @@ namespace
double err; double err;
proj_samples.push_back(ekm.project(samples[i], err)); proj_samples.push_back(ekm.project(samples[i], err));
DLIB_TEST(err <= 1e-4); DLIB_TEST(err <= 1e-4);
const double error_agreement = std::abs(err - lisf.projection_error(samples[i]));
dlog << LTRACE << "err: " << err << " error_agreement: "<< error_agreement;
DLIB_TEST(error_agreement < 1e-11);
}
for (int i = 0; i < 5; ++i)
{
sample_type temp = randm(4,1,rnd);
double err;
ekm.project(temp, err);
const double error_agreement = std::abs(err - lisf.projection_error(temp));
dlog << LTRACE << "err: " << err << " error_agreement: "<< error_agreement;
DLIB_TEST(error_agreement < 1e-11);
} }
// make sure the EKM did the projection correctly // make sure the EKM did the projection correctly
......
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