[mlpack-git] master, mlpack-1.0.x: Outsource the matrix multipilcation. (0c83d09)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:53:46 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 0c83d09cfb9554968fd816fe18774411b3579b72
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Sat Jul 19 20:37:35 2014 +0000

    Outsource the matrix multipilcation.


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

0c83d09cfb9554968fd816fe18774411b3579b72
 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"



More information about the mlpack-git mailing list