14 #ifndef MLPACK_METHODS_ANN_INIT_RULES_GAUSSIAN_INIT_HPP 15 #define MLPACK_METHODS_ANN_INIT_RULES_GAUSSIAN_INIT_HPP 38 mean(mean), variance(variance)
57 W = arma::Mat<eT>(rows, cols);
59 W.imbue( [&]() {
return arma::as_scalar(
RandNormal(mean, variance)); } );
76 W = arma::Cube<eT>(rows, cols, slices);
78 for (
size_t i = 0; i < slices; i++)
79 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.
The core includes that mlpack expects; standard C++ includes and Armadillo.
GaussianInitialization(const double mean=0, const double variance=1)
Initialize the gaussian with the given mean and variance.
double RandNormal()
Generates a normally distributed random number with mean 0 and variance 1.
Miscellaneous math routines.
Miscellaneous math random-related routines.
void Initialize(arma::Cube< eT > &W, const size_t rows, const size_t cols, const size_t slices)
Initialize randomly the elements of the specified weight 3rd order tensor.
This class is used to initialize weigth matrix with a gaussian.