Commit eb3e50e4 authored by Davis King's avatar Davis King

Fixed a bug which caused the structural_svm_problem_threaded object to

crash when caching was used.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%404267
parent 158627a3
......@@ -193,9 +193,13 @@ namespace dlib
feature_vector_type ftemp;
const unsigned long num = get_num_samples();
// initialize psi_true if we haven't done so already.
// initialize psi_true and a few other things if we haven't done so already.
if (psi_true.size() == 0)
{
// initialize the cache if necessary.
if (cache.size() == 0 && max_cache_size != 0)
cache.resize(get_num_samples());
psi_true.set_size(w.size(),1);
psi_true = 0;
......@@ -256,9 +260,6 @@ namespace dlib
) const
{
if (cache.size() == 0 && max_cache_size != 0)
cache.resize(get_num_samples());
if (!skip_cache && max_cache_size != 0)
{
scalar_type best_risk = -std::numeric_limits<scalar_type>::infinity();
......
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