Commit 931fb526 authored by Davis King's avatar Davis King
Browse files

fixed test not building due to the commit I just made

parent 59d1b9d8
......@@ -66,13 +66,13 @@ namespace
oca solver;
// test the version without a non-negativity constraint on w.
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 0);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 0);
dlog << LINFO << trans(w);
true_w = -0.5, 0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
DLIB_TEST(max(abs(w-true_w)) < 1e-10);
solver.solve_with_elastic_net(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 0.5);
solver.solve_with_elastic_net(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 0.5);
dlog << LINFO << trans(w);
true_w = -0.5, 0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -81,35 +81,35 @@ namespace
print_spinner();
w_type prior = true_w;
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, prior);
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, prior);
dlog << LINFO << trans(w);
true_w = -0.5, 0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
DLIB_TEST(max(abs(w-true_w)) < 1e-10);
prior = 0,0,0;
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, prior);
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, prior);
dlog << LINFO << trans(w);
true_w = -0.5, 0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
DLIB_TEST(max(abs(w-true_w)) < 1e-10);
prior = -1,1,0;
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, prior);
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, prior);
dlog << LINFO << trans(w);
true_w = -1.0, 1.0, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
DLIB_TEST(max(abs(w-true_w)) < 1e-10);
prior = -0.2,0.2,0;
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, prior);
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, prior);
dlog << LINFO << trans(w);
true_w = -0.5, 0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
DLIB_TEST(max(abs(w-true_w)) < 1e-10);
prior = -10.2,-1,0;
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, prior);
solver(make_oca_problem_c_svm<w_type>(20.0, 30.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, prior);
dlog << LINFO << trans(w);
true_w = -10.2, -1.0, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -118,7 +118,7 @@ namespace
print_spinner();
// test the version with a non-negativity constraint on w.
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 9999);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 9999);
dlog << LINFO << trans(w);
true_w = 0, 1, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -134,7 +134,7 @@ namespace
print_spinner();
// test the version with a non-negativity constraint on w.
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 2);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 2);
dlog << LINFO << trans(w);
true_w = 0, 1, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -144,7 +144,7 @@ namespace
// test the version with a non-negativity constraint on w.
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 1);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 1);
dlog << LINFO << trans(w);
true_w = 0, 1, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -159,7 +159,7 @@ namespace
y.push_back(+1);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 0);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 0);
dlog << LINFO << trans(w);
true_w = 0.5, -0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -167,7 +167,7 @@ namespace
print_spinner();
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 1);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 1);
dlog << LINFO << trans(w);
true_w = 0.5, -0.5, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -175,7 +175,7 @@ namespace
print_spinner();
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 2);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 2);
dlog << LINFO << trans(w);
true_w = 1, 0, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......@@ -183,7 +183,7 @@ namespace
print_spinner();
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 40, max_index_plus_one(x)), w, 5);
solver(make_oca_problem_c_svm<w_type>(2.0, 3.0, mat(x), mat(y), false, 1e-12, 0.0, 40, max_index_plus_one(x)), w, 5);
dlog << LINFO << trans(w);
true_w = 1, 0, 0;
dlog << LINFO << "error: "<< max(abs(w-true_w));
......
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