From 094c357ae269ee9d7bbfdd3db842bfe2d8d730e8 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 22 Jun 2013 21:43:13 -0400 Subject: [PATCH] Changed code to avoid an unnecessary computation. --- dlib/svm/function.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlib/svm/function.h b/dlib/svm/function.h index 4abe133c6..7f25d037f 100644 --- a/dlib/svm/function.h +++ b/dlib/svm/function.h @@ -788,7 +788,7 @@ namespace dlib scalar_type best_val = dot(rowm(weights,0),x) - b(0); unsigned long best_idx = 0; - for (unsigned long i = 0; i < labels.size(); ++i) + for (unsigned long i = 1; i < labels.size(); ++i) { scalar_type temp = dot(rowm(weights,i),x) - b(i); if (temp > best_val)