[mlpack] 198/324: Outsource the matrix multipilcation.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:22:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 9751e202f56d463cfa973dd61789705ea2d00a97
Author: marcus <marcus at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Sat Jul 19 20:37:35 2014 +0000

    Outsource the matrix multipilcation.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16840 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp | 3 ++-
 src/mlpack/tests/kernel_pca_test.cpp                        | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp b/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
index 01ae911..02f4fc2 100644
--- a/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
+++ b/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
@@ -81,7 +81,8 @@ void NystroemMethod<KernelType, PointSelectionPolicy>::Apply(arma::mat& output)
   arma::svd(U, s, V, miniKernel);
 
   // Construct the output matrix.
-  output = semiKernel * (U * arma::diagmat(1.0 / sqrt(s))) * V;
+  arma::mat normalization = (U * arma::diagmat(1.0 / sqrt(s)));
+  output = semiKernel * normalization * V;
 }
 
 }; // namespace kernel
diff --git a/src/mlpack/tests/kernel_pca_test.cpp b/src/mlpack/tests/kernel_pca_test.cpp
index e1459a0..dae716f 100644
--- a/src/mlpack/tests/kernel_pca_test.cpp
+++ b/src/mlpack/tests/kernel_pca_test.cpp
@@ -6,8 +6,8 @@
  */
 #include <mlpack/core.hpp>
 #include <mlpack/core/kernels/gaussian_kernel.hpp>
-#include <mlpack/methods/kernel_pca/kernel_pca.hpp>
 #include <mlpack/methods/kernel_pca/kernel_rules/nystroem_method.hpp>
+#include <mlpack/methods/kernel_pca/kernel_pca.hpp>
 
 #include <boost/test/unit_test.hpp>
 #include "old_boost_test_definitions.hpp"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list