Skip to content

Commit

Permalink
fix: svm prediction with alll db combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
beniz authored and sileht committed Sep 22, 2020
1 parent 6e925f2 commit d8e2961
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backends/caffe/caffeinputconns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,7 @@ namespace dd
const int &label, const std::unordered_map<int, double> &vals,
const int &count)
{
if (!_db)
if (!_db || !_train)
{
SVMInputFileConn::add_test_svmline(label, vals, count);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/svminputfileconn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace dd
std::unordered_map<int, double> vals;
int label;
read_svm_line(hline, vals, label);
if (train_lines > 0 && nlines < train_lines)
if (train_lines == 0 || (train_lines > 0 && nlines < train_lines))
add_train_svmline(label, vals, nlines);
else
{
Expand Down

0 comments on commit d8e2961

Please sign in to comment.