[mlpack-git] master: add example (2aea096)

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


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

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

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

commit 2aea09690cec4bc2f40022372ce37eb14c0e3e26
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date:   Tue Oct 27 17:24:13 2015 +0800

    add example


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

2aea09690cec4bc2f40022372ce37eb14c0e3e26
 .../methods/sparse_autoencoder/maximal_inputs.hpp      | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/mlpack/methods/sparse_autoencoder/maximal_inputs.hpp b/src/mlpack/methods/sparse_autoencoder/maximal_inputs.hpp
index 87a6e8f..259071c 100644
--- a/src/mlpack/methods/sparse_autoencoder/maximal_inputs.hpp
+++ b/src/mlpack/methods/sparse_autoencoder/maximal_inputs.hpp
@@ -11,6 +11,24 @@ namespace nn {
  * Maximize the hidden units of the parameters
  * @param params The parameters want to maximize
  * @param output Parameters after maximize
+ * @code
+ * arma::mat data; // Data matrix.
+ * const size_t vSize = 64; // Size of visible layer, depends on the data.
+ * const size_t hSize = 25; // Size of hidden layer, depends on requirements.
+ *
+ *
+ * const size_t numBasis = 5; // Parameter required for L-BFGS algorithm.
+ * const size_t numIterations = 100; // Maximum number of iterations.
+ *
+ * // Use an instantiated optimizer for the training.
+ * SparseAutoencoderFunction saf(data, vSize, hSize);
+ * L_BFGS<SparseAutoencoderFunction> optimizer(saf, numBasis, numIterations);
+ * SparseAutoencoder<L_BFGS> encoder2(optimizer);
+ *
+ * arma::mat maximalInput; //store the features learned by sparse autoencoder
+ * mlpack::nn::MaximalInputs(encoder2.Parameters(), maximalInput);
+ * maximalInput.save("trained.pgm", arma::pgm_binary);
+ * @endcode
  */
 void MaximalInputs(arma::mat const &parameters, arma::mat &output);
 



More information about the mlpack-git mailing list