26 #ifndef MLPACK_METHODS_ANN_INIT_RULES_NGUYEN_WIDROW_INIT_HPP 27 #define MLPACK_METHODS_ANN_INIT_RULES_NGUYEN_WIDROW_INIT_HPP 75 void Initialize(arma::Mat<eT>& W,
const size_t rows,
const size_t cols)
80 double beta = 0.7 * std::pow(cols, 1 / rows);
81 W *= (beta / arma::norm(W));
99 W = arma::Cube<eT>(rows, cols, slices);
101 for (
size_t i = 0; i < slices; i++)
Linear algebra utility functions, generally performed on matrices or vectors.
const double lowerBound
The number used as lower bound.
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize the elements of the specified weight matrix with the Nguyen-Widrow method.
This class is used to initialize randomly the weight matrix.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const double upperBound
The number used as upper bound.
NguyenWidrowInitialization(const double lowerBound=-0.5, const double upperBound=0.5)
Initialize the random initialization rule with the given lower bound and upper bound.
This class is used to initialize the weight matrix with the Nguyen-Widrow method. ...
void Initialize(arma::Cube< eT > &W, const size_t rows, const size_t cols, const size_t slices)
Initialize the elements of the specified weight 3rd order tensor with the Nguyen-Widrow method...
void Initialize(arma::Mat< eT > &W, const size_t rows, const size_t cols)
Initialize randomly the elements of the specified weight matrix.