[mlpack-svn] r12741 - mlpack/trunk/src/mlpack/methods/maxip

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon May 21 12:06:48 EDT 2012


Author: rcurtin
Date: 2012-05-21 12:06:46 -0400 (Mon, 21 May 2012)
New Revision: 12741

Modified:
   mlpack/trunk/src/mlpack/methods/maxip/max_ip_impl.hpp
Log:
Needs to be the square root, not actually K(q, q).


Modified: mlpack/trunk/src/mlpack/methods/maxip/max_ip_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/maxip/max_ip_impl.hpp	2012-05-21 15:54:42 UTC (rev 12740)
+++ mlpack/trunk/src/mlpack/methods/maxip/max_ip_impl.hpp	2012-05-21 16:06:46 UTC (rev 12741)
@@ -131,8 +131,8 @@
     // Precalculate query products ( || q || for all q).
     arma::vec queryProducts(querySet.n_cols);
     for (size_t queryIndex = 0; queryIndex < querySet.n_cols; ++queryIndex)
-      queryProducts[queryIndex] = KernelType::Evaluate(
-          querySet.unsafe_col(queryIndex), querySet.unsafe_col(queryIndex));
+      queryProducts[queryIndex] = sqrt(KernelType::Evaluate(
+          querySet.unsafe_col(queryIndex), querySet.unsafe_col(queryIndex)));
 
     // Screw the CoverTreeTraverser, we'll implement it by hand.
     for (size_t queryIndex = 0; queryIndex < querySet.n_cols; ++queryIndex)




More information about the mlpack-svn mailing list