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);