mlpack
|
#include "maximal_inputs.hpp"
Namespaces | |
mlpack | |
Linear algebra utility functions, generally performed on matrices or vectors. | |
Functions | |
void | mlpack::nn::MaximalInputs (const arma::mat ¶meters, arma::mat &output) |
Given a parameters matrix from an autoencoder, maximize the hidden units of the parameters, storing the maximal inputs in the given output matrix. More... | |
void | mlpack::nn::NormalizeColByMax (const arma::mat &input, arma::mat &output) |
Normalize each column of the input matrix by its maximum value, if that maximum value is not zero. More... | |
Implementation of MaximalInputs().
mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.
void mlpack::nn::MaximalInputs | ( | const arma::mat & | parameters, |
arma::mat & | output | ||
) |
Given a parameters matrix from an autoencoder, maximize the hidden units of the parameters, storing the maximal inputs in the given output matrix.
Details can be found on the 'Visualizing a Trained Autoencoder' page of the Stanford UFLDL tutorial:
http://deeplearning.stanford.edu/wiki/index.php/Main_Page
This function is based on the implementation (display_network.m) from the "Exercise: Sparse Autoencoder" page of the UFLDL tutorial:
http://deeplearning.stanford.edu/wiki/index.php/Exercise:Sparse_Autoencoder
Example usage of this function can be seen below. Note that this function can work with the ColumnsToBlocks class in order to reshape the maximal inputs for visualization, as in the UFLDL tutorial. The code below demonstrates this.
The layout of the parameters matrix should be same as following
Also, the square root of vSize must be an integer (i.e. vSize must be a perfect square).
parameters | The parameters of the autoencoder. |
output | Matrix to store the maximal inputs in. |
void mlpack::nn::NormalizeColByMax | ( | const arma::mat & | input, |
arma::mat & | output | ||
) |
Normalize each column of the input matrix by its maximum value, if that maximum value is not zero.
input | The input data to normalize. |
output | A matrix to store the input data in after normalization. |