Skip to content

Commit

Permalink
Fixed compiler errors in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed May 5, 2014
1 parent b99cffe commit a13aea2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dlib/test/svm_struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ namespace

typedef matrix<scalar_type,0,1> w_type;
w_type weights;
multiclass_svm_problem<w_type, sample_type, label_type> problem(all_samples, all_labels,4);
const long dims = max_index_plus_one(all_samples);
trained_function_type df;
df.labels = select_all_distinct_labels(all_labels);
multiclass_svm_problem<w_type, sample_type, label_type> problem(all_samples, all_labels, df.labels, dims, 4);
problem.set_max_cache_size(3);

problem.set_c(C);
Expand All @@ -460,10 +463,7 @@ namespace
svm_objective = solver(problem, weights);


trained_function_type df;

const long dims = max_index_plus_one(all_samples);
df.labels = select_all_distinct_labels(all_labels);
df.weights = colm(reshape(weights, df.labels.size(), dims+1), range(0,dims-1));
df.b = colm(reshape(weights, df.labels.size(), dims+1), dims);
return df;
Expand Down

0 comments on commit a13aea2

Please sign in to comment.