From c2a832707682f88d138f463aa9d8447bdb8ad9ab Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 2 Apr 2010 13:08:25 +0000 Subject: [PATCH] Removed cruft --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403562 --- dlib/svm/empirical_kernel_map.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlib/svm/empirical_kernel_map.h b/dlib/svm/empirical_kernel_map.h index 383fdde92..b2e6513a9 100644 --- a/dlib/svm/empirical_kernel_map.h +++ b/dlib/svm/empirical_kernel_map.h @@ -188,11 +188,9 @@ namespace dlib temp1 = kernel_matrix(kernel, basis, samp); temp2 = weights*temp1; + // This value should never be negative (it measures squared distance) but I'm putting the abs() + // here just for good measure since rounding error might push it slightly negative. projection_error = std::abs( kernel(samp,samp) - dot(temp2,temp2)); - // Rounding error could make the expression slightly negative which is an impossible result - // since it measures a distance. Just force it to be zero in that case. - if (projection_error < 0) - projection_error = 0; return temp2; }