15 #ifndef __MLPACK_METHODS_SPARSE_AUTOENCODER_SPARSE_AUTOENCODER_FUNCTION_HPP 16 #define __MLPACK_METHODS_SPARSE_AUTOENCODER_SPARSE_AUTOENCODER_FUNCTION_HPP 45 const double lambda = 0.0001,
46 const double beta = 3,
47 const double rho = 0.01);
62 double Evaluate(
const arma::mat& parameters)
const;
73 void Gradient(
const arma::mat& parameters, arma::mat& gradient)
const;
81 void Sigmoid(
const arma::mat& x, arma::mat& output)
const 83 output = (1.0 / (1 + arma::exp(-x)));
92 this->visibleSize = visible;
104 this->hiddenSize = hidden;
double Beta() const
Gets the KL divergence parameter.
size_t VisibleSize() const
Gets size of the visible layer.
double lambda
L2-regularization parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
This is a class for the sparse autoencoder objective function.
SparseAutoencoderFunction(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 objective function with the given parameters.
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization.
void Rho(const double r)
Sets the sparsity 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'...
const arma::mat & data
The matrix of data points.
void Gradient(const arma::mat ¶meters, arma::mat &gradient) const
Evaluates the gradient values of the objective function given the current set of parameters.
size_t visibleSize
Size of the visible layer.
size_t hiddenSize
Size of the hidden layer.
arma::mat initialPoint
Initial parameter vector.
void HiddenSize(const size_t hidden)
Sets size of the hidden layer.
double Evaluate(const arma::mat ¶meters) const
Evaluates the objective function of the sparse autoencoder model using the given parameters.
const arma::mat InitializeWeights()
Initializes the parameters of the model to suitable values.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
void Beta(const double b)
Sets the KL divergence parameter.
void VisibleSize(const size_t visible)
Sets size of the visible layer.
double rho
Sparsity parameter.
double Rho() const
Gets the sparsity parameter.
double beta
KL divergence parameter.
double Lambda() const
Gets the L2-regularization parameter.
void Lambda(const double l)
Sets the L2-regularization parameter.
size_t HiddenSize() const
Gets the size of the hidden layer.