[mlpack-git] master,mlpack-1.0.x: Easy fix for #355. (fa80c3f)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:49:53 EST 2015


Repository : https://github.com/mlpack/mlpack

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit fa80c3f8096818494e89d34136a438dc746bd7e5
Author: Ryan Curtin <ryan at ratml.org>
Date:   Thu Jun 26 22:39:06 2014 +0000

    Easy fix for #355.


>---------------------------------------------------------------

fa80c3f8096818494e89d34136a438dc746bd7e5
 src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp b/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
index b607d70..9e65845 100644
--- a/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
+++ b/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
@@ -44,8 +44,8 @@ void KernelPCA<KernelType>::Apply(const arma::mat& data,
   // 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-git mailing list