Made this test a little more robust.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403550
This commit is contained in:
Davis King 2010-03-07 14:14:48 +00:00
parent ff2fd9cf81
commit f13b058461
1 changed files with 5 additions and 5 deletions

View File

@ -100,8 +100,8 @@ namespace
{ {
++thetime; ++thetime;
typedef matrix<double,0,1> sample_type; typedef matrix<double,0,1> sample_type;
dlog << LINFO << "time seed: " << thetime; //dlog << LINFO << "time seed: " << thetime;
rnd.set_seed(cast_to_string(thetime)); //rnd.set_seed(cast_to_string(thetime));
running_stats<double> rs; running_stats<double> rs;
@ -157,15 +157,15 @@ namespace
alpha = C/alpha.size(); alpha = C/alpha.size();
x = alpha; x = alpha;
const unsigned long max_iter = 100000; const unsigned long max_iter = 400000;
solve_qp_using_smo(test.Q, test.b, alpha, 0.00001, max_iter); solve_qp_using_smo(test.Q, test.b, alpha, 0.00000001, max_iter);
DLIB_TEST_MSG(abs(sum(alpha) - C) < 1e-13, abs(sum(alpha) - C) ); DLIB_TEST_MSG(abs(sum(alpha) - C) < 1e-13, abs(sum(alpha) - C) );
dlog << LTRACE << "alpha: " << alpha; dlog << LTRACE << "alpha: " << alpha;
dlog << LINFO << "SMO: true objective: "<< 0.5*trans(alpha)*test.Q*alpha - trans(alpha)*test.b; dlog << LINFO << "SMO: true objective: "<< 0.5*trans(alpha)*test.Q*alpha - trans(alpha)*test.b;
double obj = find_min(bfgs_search_strategy(), double obj = find_min(bfgs_search_strategy(),
objective_delta_stop_strategy(1e-13, 1000), objective_delta_stop_strategy(1e-13, 5000),
test, test,
der, der,
x, x,