[mlpack] 199/324: Avoid direct multiplication with a diagmat.

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 4d9f654e24a50e629071906a8e78d8bdc838ecef
Author: marcus <marcus at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Sun Jul 20 10:42:27 2014 +0000

    Avoid direct multiplication with a diagmat.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16841 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp | 4 ++--
 1 file changed, 2 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 02f4fc2..231ecbf 100644
--- a/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
+++ b/src/mlpack/methods/nystroem_method/nystroem_method_impl.hpp
@@ -81,8 +81,8 @@ void NystroemMethod<KernelType, PointSelectionPolicy>::Apply(arma::mat& output)
   arma::svd(U, s, V, miniKernel);
 
   // Construct the output matrix.
-  arma::mat normalization = (U * arma::diagmat(1.0 / sqrt(s)));
-  output = semiKernel * normalization * V;
+  arma::mat normalization = arma::diagmat(1.0 / sqrt(s));
+  output = semiKernel * U * normalization * V;
 }
 
 }; // namespace kernel

-- 
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