\section{Average\+Initialization Class Reference}
\label{classmlpack_1_1amf_1_1AverageInitialization}\index{Average\+Initialization@{Average\+Initialization}}


This initialization rule initializes matrix W and H to root of the average of V, perturbed with uniform noise.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Average\+Initialization} ()
\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the object (in this case, there is nothing to do). \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\static void \textbf{ Initialize} (const Mat\+Type \&V, const size\+\_\+t r, arma\+::mat \&W, arma\+::mat \&H)
\begin{DoxyCompactList}\small\item\em Initialize the matrices W and H to the average value of V with uniform random noise added. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\static void \textbf{ Initialize\+One} (const Mat\+Type \&V, const size\+\_\+t r, arma\+::mat \&M, const bool which\+Matrix=true)
\begin{DoxyCompactList}\small\item\em Initialize the matrix W or H to the average value of V with uniform random noise added. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This initialization rule initializes matrix W and H to root of the average of V, perturbed with uniform noise. 

Uniform noise is generated by Armadillo\textquotesingle{}s \textquotesingle{}randu\textquotesingle{} function. For better performance, the lowest element of the matrix is subtracted from the average before dividing it by the factorization rank. This computed value is added with the random noise. 

Definition at line 27 of file average\+\_\+init.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1amf_1_1AverageInitialization_a202e4b31ec0c19e8d2980b08b099ba6a}} 
\index{mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}!Average\+Initialization@{Average\+Initialization}}
\index{Average\+Initialization@{Average\+Initialization}!mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}}
\subsubsection{Average\+Initialization()}
{\footnotesize\ttfamily \textbf{ Average\+Initialization} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 31 of file average\+\_\+init.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1amf_1_1AverageInitialization_a02a3610958f42b7dbef8bd5063ceaee7}} 
\index{mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}}
\subsubsection{Initialize()}
{\footnotesize\ttfamily static void Initialize (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{V,  }\item[{const size\+\_\+t}]{r,  }\item[{arma\+::mat \&}]{W,  }\item[{arma\+::mat \&}]{H }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initialize the matrices W and H to the average value of V with uniform random noise added. 


\begin{DoxyParams}{Parameters}
{\em V} & Input matrix. \\
\hline
{\em r} & Rank of matrix. \\
\hline
{\em W} & W matrix, to be initialized. \\
\hline
{\em H} & H matrix, to be initialized. \\
\hline
\end{DoxyParams}


Definition at line 43 of file average\+\_\+init.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1AverageInitialization_ac92b923632083ddeab1be9d2a33fb1af}} 
\index{mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}!Initialize\+One@{Initialize\+One}}
\index{Initialize\+One@{Initialize\+One}!mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}}
\subsubsection{Initialize\+One()}
{\footnotesize\ttfamily static void Initialize\+One (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{V,  }\item[{const size\+\_\+t}]{r,  }\item[{arma\+::mat \&}]{M,  }\item[{const bool}]{which\+Matrix = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Initialize the matrix W or H to the average value of V with uniform random noise added. 


\begin{DoxyParams}{Parameters}
{\em V} & Input matrix. \\
\hline
{\em r} & Rank of matrix. \\
\hline
{\em M} & W or H matrix, to be initialized to the average value of V with uniform random noise added. \\
\hline
{\em which\+Matrix} & If true, initialize W. Otherwise, initialize H. \\
\hline
\end{DoxyParams}


Definition at line 86 of file average\+\_\+init.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1AverageInitialization_aa5b3dd8336182f751ebec27167c22415}} 
\index{mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::amf\+::\+Average\+Initialization@{mlpack\+::amf\+::\+Average\+Initialization}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the object (in this case, there is nothing to do). 



Definition at line 122 of file average\+\_\+init.\+hpp.



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