Skip to content

Commit

Permalink
Merge pull request #872 from vigsterkr/master
Browse files Browse the repository at this point in the history
Fix unit tests for SGVector::max_abs and MOCASSVM
  • Loading branch information
vigsterkr committed Feb 13, 2013
2 parents da53770 + 59e15f5 commit 18ea338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/lib/SGVector_unittest.cc
Expand Up @@ -95,12 +95,12 @@ TEST(SGVectorTest,misc)

/* test, min, max, sum */
int arg_max = 0, arg_max_abs = 0;
float64_t min = 1025, max = -1025, sum = 0.0, max_abs = - 1, sum_abs = 0.0;
float64_t min = 1025, max = -1025, sum = 0.0, max_abs = -1, sum_abs = 0.0;
for (int32_t i = 0; i < a.vlen; ++i)
{
sum += a[i];
sum_abs += CMath::abs(a[i]);
if (CMath::abs(a[i]) > max)
if (CMath::abs(a[i]) > max_abs)
{
max_abs = CMath::abs(a[i]);
arg_max_abs=i;
Expand Down
1 change: 1 addition & 0 deletions tests/unit/multiclass/MulticlassOCAS_unittest.cc
Expand Up @@ -38,6 +38,7 @@ TEST(MulticlassOCASTest,train)
CMulticlassLabels* ground_truth = new CMulticlassLabels(labels);
CMulticlassOCAS* mocas = new CMulticlassOCAS(C, train_feats, ground_truth);
mocas->train();
mocas->parallel->set_num_threads(1);

CLabels* pred = mocas->apply(test_feats);
for (int i = 0; i < set_size; ++i)
Expand Down

0 comments on commit 18ea338

Please sign in to comment.