\section{Nguyen\+Widrow\+Initialization Class Reference}
\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization}\index{Nguyen\+Widrow\+Initialization@{Nguyen\+Widrow\+Initialization}}


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


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Nguyen\+Widrow\+Initialization} (const double lower\+Bound=-\/0.\+5, const double upper\+Bound=0.\+5)
\begin{DoxyCompactList}\small\item\em Initialize the random initialization rule with the given lower bound and upper bound. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Initialize} (arma\+::\+Mat$<$ eT $>$ \&W, const size\+\_\+t rows, const size\+\_\+t cols)
\begin{DoxyCompactList}\small\item\em Initialize the elements of the specified weight matrix with the Nguyen-\/\+Widrow method. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Initialize} (arma\+::\+Mat$<$ eT $>$ \&W)
\begin{DoxyCompactList}\small\item\em Initialize the elements of the specified weight matrix with the Nguyen-\/\+Widrow method. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Initialize} (arma\+::\+Cube$<$ eT $>$ \&W, const size\+\_\+t rows, const size\+\_\+t cols, const size\+\_\+t slices)
\begin{DoxyCompactList}\small\item\em Initialize the elements of the specified weight 3rd order tensor with the Nguyen-\/\+Widrow method. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename eT $>$ }\\void \textbf{ Initialize} (arma\+::\+Cube$<$ eT $>$ \&W)
\begin{DoxyCompactList}\small\item\em Initialize the elements of the specified weight 3rd order tensor with the Nguyen-\/\+Widrow method. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{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. 

Definition at line 53 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization_aebb458897ab391c33618e53bf599a51c}} 
\index{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}!Nguyen\+Widrow\+Initialization@{Nguyen\+Widrow\+Initialization}}
\index{Nguyen\+Widrow\+Initialization@{Nguyen\+Widrow\+Initialization}!mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}}
\subsubsection{Nguyen\+Widrow\+Initialization()}
{\footnotesize\ttfamily \textbf{ Nguyen\+Widrow\+Initialization} (\begin{DoxyParamCaption}\item[{const double}]{lower\+Bound = {\ttfamily -\/0.5},  }\item[{const double}]{upper\+Bound = {\ttfamily 0.5} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em lower\+Bound} & The number used as lower bound. \\
\hline
{\em upper\+Bound} & The number used as upper bound. \\
\hline
\end{DoxyParams}


Definition at line 63 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization_a5cfe472251a41fffd45b170bb0d3c1bd}} 
\index{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}}
\subsubsection{Initialize()\hspace{0.1cm}{\footnotesize\ttfamily [1/4]}}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{arma\+::\+Mat$<$ eT $>$ \&}]{W,  }\item[{const size\+\_\+t}]{rows,  }\item[{const size\+\_\+t}]{cols }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em W} & Weight matrix to initialize. \\
\hline
{\em rows} & Number of rows. \\
\hline
{\em cols} & Number of columns. \\
\hline
\end{DoxyParams}


Definition at line 76 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



References Random\+Initialization\+::\+Initialize().



Referenced by Nguyen\+Widrow\+Initialization\+::\+Initialize().

\mbox{\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization_af2d770912321b8b9ca7b03ab98f735c0}} 
\index{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}}
\subsubsection{Initialize()\hspace{0.1cm}{\footnotesize\ttfamily [2/4]}}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{arma\+::\+Mat$<$ eT $>$ \&}]{W }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em W} & Weight matrix to initialize. \\
\hline
\end{DoxyParams}


Definition at line 92 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



References Random\+Initialization\+::\+Initialize().

\mbox{\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization_a40a2b6466bdba0f6aab4eb92b6e65934}} 
\index{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}}
\subsubsection{Initialize()\hspace{0.1cm}{\footnotesize\ttfamily [3/4]}}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{arma\+::\+Cube$<$ eT $>$ \&}]{W,  }\item[{const size\+\_\+t}]{rows,  }\item[{const size\+\_\+t}]{cols,  }\item[{const size\+\_\+t}]{slices }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em W} & Weight matrix to initialize. \\
\hline
{\em rows} & Number of rows. \\
\hline
{\em cols} & Number of columns. \\
\hline
{\em slices} & Number of slices. \\
\hline
\end{DoxyParams}


Definition at line 111 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



References Nguyen\+Widrow\+Initialization\+::\+Initialize().

\mbox{\label{classmlpack_1_1ann_1_1NguyenWidrowInitialization_ae2f3e6d570824a160b687ff9f734f83c}} 
\index{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization@{mlpack\+::ann\+::\+Nguyen\+Widrow\+Initialization}}
\subsubsection{Initialize()\hspace{0.1cm}{\footnotesize\ttfamily [4/4]}}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{arma\+::\+Cube$<$ eT $>$ \&}]{W }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


\begin{DoxyParams}{Parameters}
{\em W} & Weight matrix to initialize. \\
\hline
\end{DoxyParams}


Definition at line 130 of file nguyen\+\_\+widrow\+\_\+init.\+hpp.



References Log\+::\+Fatal, and Nguyen\+Widrow\+Initialization\+::\+Initialize().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/methods/ann/init\+\_\+rules/\textbf{ nguyen\+\_\+widrow\+\_\+init.\+hpp}\end{DoxyCompactItemize}
