[mlpack-svn] r16722 - mlpack/trunk/src/mlpack/methods/kernel_pca

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu Jun 26 18:39:06 EDT 2014


Author: rcurtin
Date: Thu Jun 26 18:39:06 2014
New Revision: 16722

Log:
Easy fix for #355.


Modified:
   mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp

Modified: mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp	Thu Jun 26 18:39:06 2014
@@ -44,8 +44,8 @@
   // center the data. So, we perform a "psuedo-centering" using the kernel
   // matrix.
   arma::rowvec rowMean = arma::sum(kernelMatrix, 0) / kernelMatrix.n_cols;
-  kernelMatrix.each_row() -= rowMean;
   kernelMatrix.each_col() -= arma::sum(kernelMatrix, 1) / kernelMatrix.n_cols;
+  kernelMatrix.each_row() -= rowMean;
   kernelMatrix += arma::sum(rowMean) / kernelMatrix.n_cols;
 
   // Eigendecompose the centered kernel matrix.



More information about the mlpack-svn mailing list