[mlpack-git] master: refine test case (346a52f)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Nov 30 10:40:34 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/5aaf0e441dd64a5de9a0210aa7a837eecf162d12...e4519fc42a2a340cf0387ab082bf49b9715c871b

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

commit 346a52f90e7916fe3036d603f97f92598919f233
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date:   Thu Nov 12 15:57:18 2015 +0800

    refine test case


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

346a52f90e7916fe3036d603f97f92598919f233
 src/mlpack/tests/maximal_inputs_test.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/tests/maximal_inputs_test.cpp b/src/mlpack/tests/maximal_inputs_test.cpp
index ecd36c6..cc6a187 100644
--- a/src/mlpack/tests/maximal_inputs_test.cpp
+++ b/src/mlpack/tests/maximal_inputs_test.cpp
@@ -5,6 +5,7 @@
  * Test the MaximalInputs and ColumnsToBlocks functions.
  */
 #include <mlpack/core.hpp>
+#include <mlpack/core/math/columns_to_blocks.hpp>
 #include <mlpack/methods/sparse_autoencoder/maximal_inputs.hpp>
 
 #include <boost/test/unit_test.hpp>
@@ -24,11 +25,11 @@ BOOST_AUTO_TEST_CASE(ColumnToBlocksEvaluate)
   input.submat(0, 0, 1, 3) = w1;
 
   arma::mat maximalInputs;  
-  const std::pair<arma::uword, arma::uword> size =
-          mlpack::nn::MaximalInputs(input, maximalInputs);
+  mlpack::nn::MaximalInputs(input, maximalInputs);
 
   arma::mat output;  
-  mlpack::nn::ColumnsToBlocks(maximalInputs, output, size.first, size.second);
+  mlpack::math::ColumnsToBlocks ctb(1,2);
+  ctb.Transform(maximalInputs, output);
 
   arma::mat matlabResults;
   matlabResults<<-1<<-1<<-1<<-1<<-1<<-1<<-1<<arma::endr



More information about the mlpack-git mailing list