[mlpack-svn] r16840 - in mlpack/trunk/src/mlpack: methods/nystroem_method tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Sat Jul 19 16:37:36 EDT 2014
Author: marcus
Date: Sat Jul 19 16:37:35 2014
New Revision: 16840
Log:
Outsource the matrix multipilcation.
Modified:
mlpack/trunk/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
mlpack/trunk/src/mlpack/tests/kernel_pca_test.cpp
Modified: mlpack/trunk/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp Sat Jul 19 16:37:35 2014
@@ -81,7 +81,8 @@
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
Modified: mlpack/trunk/src/mlpack/tests/kernel_pca_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/kernel_pca_test.cpp (original)
+++ mlpack/trunk/src/mlpack/tests/kernel_pca_test.cpp Sat Jul 19 16:37:35 2014
@@ -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-svn
mailing list