12 #ifndef MLPACK_METHODS_SPARSE_AUTOENCODER_SPARSE_AUTOENCODER_HPP
13 #define MLPACK_METHODS_SPARSE_AUTOENCODER_SPARSE_AUTOENCODER_HPP
85 const size_t visibleSize,
86 const size_t hiddenSize,
87 const double lambda = 0.0001,
88 const double beta = 3,
89 const double rho = 0.01);
118 void Sigmoid(
const arma::mat& x, arma::mat& output)
const
120 output = (1.0 / (1 + arma::exp(-x)));
126 this->visibleSize = visible;
138 this->hiddenSize = hidden;
185 arma::mat parameters;
202 #include "sparse_autoencoder_impl.hpp"
size_t HiddenSize() const
Gets the size of the hidden layer.
double Beta() const
Gets the KL divergence parameter.
void GetNewFeatures(arma::mat &data, arma::mat &features)
Transforms the provided data into the representation learned by the sparse autoencoder.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Rho(const double r)
Sets the sparsity parameter.
SparseAutoencoder(const arma::mat &data, const size_t visibleSize, const size_t hiddenSize, const double lambda=0.0001, const double beta=3, const double rho=0.01)
Construct the sparse autoencoder model with the given training data.
double Rho() const
Gets the sparsity parameter.
A sparse autoencoder is a neural network whose aim to learn compressed representations of the data...
void Lambda(const double l)
Sets the L2-regularization parameter.
void Beta(const double b)
Sets the KL divergence parameter.
void Sigmoid(const arma::mat &x, arma::mat &output) const
Returns the elementwise sigmoid of the passed matrix, where the sigmoid function of a real number 'x'...
size_t VisibleSize() const
Gets size of the visible layer.
The generic L-BFGS optimizer, which uses a back-tracking line search algorithm to minimize a function...
void HiddenSize(const size_t hidden)
Sets size of the hidden layer.
void VisibleSize(const size_t visible)
Sets size of the visible layer.
double Lambda() const
Gets the L2-regularization parameter.