mlpack
Public Member Functions | List of all members
mlpack::ann::NguyenWidrowInitialization Class Reference

This class is used to initialize the weight matrix with the Nguyen-Widrow method. More...

#include <nguyen_widrow_init.hpp>

Public Member Functions

 NguyenWidrowInitialization (const double lowerBound=-0.5, const double upperBound=0.5)
 Initialize the random initialization rule with the given lower bound and upper bound. More...
 
template<typename eT >
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. More...
 
template<typename eT >
void Initialize (arma::Mat< eT > &W)
 Initialize the elements of the specified weight matrix with the Nguyen-Widrow 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 the Nguyen-Widrow method. More...
 
template<typename eT >
void Initialize (arma::Cube< eT > &W)
 Initialize the elements of the specified weight 3rd order tensor with the Nguyen-Widrow method. More...
 

Detailed Description

This class is used to initialize the weight matrix with the Nguyen-Widrow method.

The method is defined by

\begin{eqnarray*} \gamma &\le& w_i \le \gamma \\ \beta &=& 0.7H^{\frac{1}{I}} \\ n &=& \sqrt{\sum_{i=0}{I}w_{i}^{2}} \\ w_i &=& \frac{\beta w_i}{n} \end{eqnarray*}

Where H is the number of neurons in the outgoing layer, I represents the number of neurons in the ingoing layer and gamma defines the random interval that is used to initialize the weights with a random value in a specific range.

Constructor & Destructor Documentation

◆ NguyenWidrowInitialization()

mlpack::ann::NguyenWidrowInitialization::NguyenWidrowInitialization ( const double  lowerBound = -0.5,
const double  upperBound = 0.5 
)
inline

Initialize the random initialization rule with the given lower bound and upper bound.

Parameters
lowerBoundThe number used as lower bound.
upperBoundThe number used as upper bound.

Member Function Documentation

◆ Initialize() [1/4]

template<typename eT >
void mlpack::ann::NguyenWidrowInitialization::Initialize ( arma::Mat< eT > &  W,
const size_t  rows,
const size_t  cols 
)
inline

Initialize the elements of the specified weight matrix with the Nguyen-Widrow method.

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

◆ Initialize() [2/4]

template<typename eT >
void mlpack::ann::NguyenWidrowInitialization::Initialize ( arma::Mat< eT > &  W)
inline

Initialize the elements of the specified weight matrix with the Nguyen-Widrow method.

Parameters
WWeight matrix to initialize.

◆ Initialize() [3/4]

template<typename eT >
void mlpack::ann::NguyenWidrowInitialization::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 the Nguyen-Widrow method.

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

◆ Initialize() [4/4]

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

Initialize the elements of the specified weight 3rd order tensor with the Nguyen-Widrow method.

Parameters
WWeight matrix to initialize.

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