15 #ifndef MLPACK_METHODS_ANN_INIT_RULES_LECUN_NORMAL_INIT_HPP 16 #define MLPACK_METHODS_ANN_INIT_RULES_LECUN_NORMAL_INIT_HPP 75 const double variance = 1.0 / ((double) rows);
79 W.set_size(rows, cols);
84 W.imbue( [&]() {
return sqrt(variance) * arma::randn(); } );
102 W.set_size(rows, cols, slices);
104 for (
size_t i = 0; i < slices; i++)
The core includes that mlpack expects; standard C++ includes and Armadillo.
This class is used to initialize weight matrix with the Lecun Normalization initialization rule...
void Initialize(arma::mat &W, const size_t rows, const size_t cols)
Initialize the elements of the weight matrix with the Lecun Normal initialization rule...
void Initialize(arma::cube &W, const size_t rows, const size_t cols, const size_t slices)
Initialize the elements of the specified weight 3rd order tensor with Lecun Normal initialization rul...
LecunNormalInitialization()
Initialize the LecunNormalInitialization object.
Miscellaneous math random-related routines.