Commit bb75e2da authored by Davis King's avatar Davis King

Switched the batch mode kernel cache to use whatever floating point

type the rest of the code is using because otherwise it can negatively
impact the results of training.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403163
parent 388441ee
...@@ -452,7 +452,7 @@ namespace dlib ...@@ -452,7 +452,7 @@ namespace dlib
struct cache_type struct cache_type
{ {
matrix<float> kernel; matrix<scalar_type> kernel;
std::vector<long> sample_location; // where in the cache a sample is. -1 means not in cache std::vector<long> sample_location; // where in the cache a sample is. -1 means not in cache
std::vector<std::pair<long,long> > frequency_of_use; std::vector<std::pair<long,long> > frequency_of_use;
......
...@@ -369,7 +369,8 @@ namespace ...@@ -369,7 +369,8 @@ namespace
dlog << LDEBUG << "peg cached cv: " << peg_c_cv; dlog << LDEBUG << "peg cached cv: " << peg_c_cv;
// make sure the cached version of pegasos computes the same result // make sure the cached version of pegasos computes the same result
DLIB_TEST(sum(abs(peg_cv - peg_c_cv)) < std::sqrt(std::numeric_limits<double>::epsilon())); DLIB_TEST_MSG(sum(abs(peg_cv - peg_c_cv)) < std::sqrt(std::numeric_limits<double>::epsilon()),
sum(abs(peg_cv - peg_c_cv)) << " \n" << peg_cv << peg_c_cv );
DLIB_TEST_MSG(mean(rvm_cv) > 0.9, rvm_cv); DLIB_TEST_MSG(mean(rvm_cv) > 0.9, rvm_cv);
DLIB_TEST_MSG(mean(svm_cv) > 0.9, svm_cv); DLIB_TEST_MSG(mean(svm_cv) > 0.9, svm_cv);
......
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