mlpack
Public Member Functions | List of all members
mlpack::ann::GlorotInitializationType< Uniform > Class Template Reference

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)
 

Detailed Description

template<bool Uniform = true>
class mlpack::ann::GlorotInitializationType< Uniform >

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.

@inproceedings {pmlr-v9-glorot10a,
title = {Understanding the difficulty of training
deep feedforward neural networks},
author = {Xavier Glorot and Yoshua Bengio},
booktitle = {Proceedings of the Thirteenth International Conference
on Artificial Intelligence and Statistics},
year = {2010}
}

Member Function Documentation

◆ Initialize() [1/4]

template<bool Uniform = true>
template<typename eT >
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.

Parameters
WWeight matrix to initialize.
rowsNumber of rows.
colsNumber of columns.

◆ Initialize() [2/4]

template<bool Uniform = true>
template<typename eT >
void mlpack::ann::GlorotInitializationType< Uniform >::Initialize ( arma::Mat< eT > &  W)

Initialize the elements weight matrix with glorot initialization method.

Parameters
WWeight matrix to initialize.

◆ Initialize() [3/4]

template<bool Uniform>
template<typename eT >
void mlpack::ann::GlorotInitializationType< Uniform >::Initialize ( arma::Cube< eT > &  W,
const size_t  rows,
const size_t  cols,
const size_t  slices 
)
inline

Initialize the elements of the specified weight 3rd order tensor with glorot initialization method.

Parameters
WWeight matrix to initialize.
rowsNumber of rows.
colsNumber of columns.
slicesNumber of slices.

◆ Initialize() [4/4]

template<bool Uniform>
template<typename eT >
void mlpack::ann::GlorotInitializationType< Uniform >::Initialize ( arma::Cube< eT > &  W)
inline

Initialize the elements of the specified weight 3rd order tensor with glorot initialization method.

Parameters
WWeight matrix to initialize.

The documentation for this class was generated from the following file: