[mlpack-git] master: Use n_rows and n_cols to define the matrix size instead of arma::size(). (04fe0d5)

gitdub at mlpack.org gitdub at mlpack.org
Wed May 25 10:08:45 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/1f562a1aba7ae55475afcc95659511c2b7f694e5...5b8fdce471328f722fcd8c0f22a6d995ce22c98b

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

commit 04fe0d5198b6f138c1d1eff23b7c7f7100db7ca9
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Wed May 25 16:08:45 2016 +0200

    Use n_rows and n_cols to define the matrix size instead of arma::size().


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

04fe0d5198b6f138c1d1eff23b7c7f7100db7ca9
 src/mlpack/methods/CMakeLists.txt                       |  1 +
 src/mlpack/methods/ann/layer/reinforce_normal_layer.hpp |  7 ++++---
 src/mlpack/methods/{cf => rmva}/CMakeLists.txt          | 15 +++++++++------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/mlpack/methods/CMakeLists.txt b/src/mlpack/methods/CMakeLists.txt
index d0ea04c..209beef 100644
--- a/src/mlpack/methods/CMakeLists.txt
+++ b/src/mlpack/methods/CMakeLists.txt
@@ -47,6 +47,7 @@ set(DIRS
   radical
   range_search
   rann
+  rmva
   regularized_svd
   softmax_regression
   sparse_autoencoder
diff --git a/src/mlpack/methods/ann/layer/reinforce_normal_layer.hpp b/src/mlpack/methods/ann/layer/reinforce_normal_layer.hpp
index 7dbe089..3f8099f 100644
--- a/src/mlpack/methods/ann/layer/reinforce_normal_layer.hpp
+++ b/src/mlpack/methods/ann/layer/reinforce_normal_layer.hpp
@@ -46,13 +46,14 @@ class ReinforceNormalLayer
    * @param input Input data used for evaluating the specified function.
    * @param output Resulting output activation.
    */
-  template<typename InputType, typename OutputType>
-  void Forward(const InputType& input, OutputType& output)
+  template<typename eT>
+  void Forward(const arma::Mat<eT>& input, arma::Mat<eT>& output)
   {
     if (!deterministic)
     {
       // Multiply by standard deviations and re-center the means to the mean.
-      output = arma::randn<OutputType>(arma::size(input)) * stdev + input;
+      output = arma::randn<arma::Mat<eT> >(input.n_rows, input.n_cols) *
+          stdev + input;
     }
     else
     {
diff --git a/src/mlpack/methods/cf/CMakeLists.txt b/src/mlpack/methods/rmva/CMakeLists.txt
similarity index 71%
copy from src/mlpack/methods/cf/CMakeLists.txt
copy to src/mlpack/methods/rmva/CMakeLists.txt
index 30f5a4f..d075ce3 100644
--- a/src/mlpack/methods/cf/CMakeLists.txt
+++ b/src/mlpack/methods/rmva/CMakeLists.txt
@@ -1,11 +1,8 @@
 # Define the files we need to compile
 # Anything not in this list will not be compiled into mlpack.
 set(SOURCES
-  cf.hpp
-  cf_impl.hpp
-  cf.cpp
-  svd_wrapper.hpp
-  svd_wrapper_impl.hpp
+  rmva.hpp
+  rmva_impl.hpp
 )
 
 # Add directory name to sources.
@@ -17,4 +14,10 @@ endforeach()
 # the parent scope).
 set(MLPACK_SRCS ${MLPACK_SRCS} ${DIR_SRCS} PARENT_SCOPE)
 
-add_cli_executable (cf)
+add_executable(mlpack_rmva
+  rmva_main.cpp
+)
+target_link_libraries(mlpack_rmva
+  mlpack
+)
+install(TARGETS mlpack_rmva RUNTIME DESTINATION bin)




More information about the mlpack-git mailing list