mlpack
|
This class is used to initialize the weight matrix with the Glorot Initialization method. More...
#include <glorot_init.hpp>
Public Member Functions | |
GlorotInitializationType () | |
Initialize the Glorot initialization object. | |
template<typename eT > | |
void | Initialize (arma::Mat< eT > &W, const size_t rows, const size_t cols) |
Initialize the elements weight matrix with glorot initialization method. More... | |
template<typename eT > | |
void | Initialize (arma::Mat< eT > &W) |
Initialize the elements weight matrix with glorot initialization method. More... | |
template<typename eT > | |
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 glorot initialization method. More... | |
template<typename eT > | |
void | Initialize (arma::Cube< eT > &W) |
Initialize the elements of the specified weight 3rd order tensor with glorot initialization method. More... | |
template<> | |
void | Initialize (arma::Mat< eT > &W, const size_t rows, const size_t cols) |
template<> | |
void | Initialize (arma::Mat< eT > &W) |
template<> | |
void | Initialize (arma::Mat< eT > &W, const size_t rows, const size_t cols) |
template<> | |
void | Initialize (arma::Mat< eT > &W) |
This class is used to initialize the weight matrix with the Glorot Initialization method.
The method is defined by
\begin{eqnarray*} \mathrm{Var}[w_i] &=& \frac{2}{n_i + n_{i+1}} \\ w_i \sim \mathrm{U}[-\frac{\sqrt{6}}{\sqrt{n_i + n_{i+1}}}, \frac{\sqrt{6}}{\sqrt{n_i + n_{i+1}}}] \end{eqnarray*}
where \( n_{i+1} \) is the number of neurons in the outgoing layer, \( n_i \) represents the number of neurons in the ingoing layer. Here Normal Distribution may also be used if needed
For more information, see the following paper.
void mlpack::ann::GlorotInitializationType< Uniform >::Initialize | ( | arma::Mat< eT > & | W, |
const size_t | rows, | ||
const size_t | cols | ||
) |
Initialize the elements weight matrix with glorot initialization method.
W | Weight matrix to initialize. |
rows | Number of rows. |
cols | Number of columns. |
void mlpack::ann::GlorotInitializationType< Uniform >::Initialize | ( | arma::Mat< eT > & | W | ) |
Initialize the elements weight matrix with glorot initialization method.
W | Weight matrix to initialize. |
|
inline |
Initialize the elements of the specified weight 3rd order tensor with glorot initialization method.
W | Weight matrix to initialize. |
rows | Number of rows. |
cols | Number of columns. |
slices | Number of slices. |
|
inline |
Initialize the elements of the specified weight 3rd order tensor with glorot initialization method.
W | Weight matrix to initialize. |