14 #ifndef MLPACK_METHODS_ANN_INIT_RULES_GLOROT_INIT_HPP 15 #define MLPACK_METHODS_ANN_INIT_RULES_GLOROT_INIT_HPP 54 template<
bool Uniform = true>
74 void Initialize(arma::Mat<eT>& W,
88 void Initialize(arma::Cube<eT>& W,
101 W = arma::mat(rows, cols);
103 double var = 2.0/double(rows + cols);
109 template<
typename eT>
115 W = arma::mat(rows, cols);
118 double a = sqrt(6) / sqrt(rows + cols);
123 template <
bool Uniform>
124 template<
typename eT>
132 W = arma::cube(rows, cols, slices);
134 for (
size_t i = 0; i < slices; i++)
135 Initialize(W.slice(i), rows, cols);
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize the elements weight matrix using a Gaussian Distribution.
This class is used to initialize randomly the weight matrix.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize randomly the elements of the specified weight matrix.
Miscellaneous math routines.
GlorotInitializationType()
Initialize the Glorot initialization object.
This class is used to initialize the weight matrix with the Glorot Initialization method...
This class is used to initialize weigth matrix with a gaussian.