\section{Validation\+R\+M\+S\+E\+Termination$<$ Mat\+Type $>$ Class Template Reference}
\label{classmlpack_1_1amf_1_1ValidationRMSETermination}\index{Validation\+R\+M\+S\+E\+Termination$<$ Mat\+Type $>$@{Validation\+R\+M\+S\+E\+Termination$<$ Mat\+Type $>$}}


This class implements validation termination policy based on R\+M\+SE index.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Validation\+R\+M\+S\+E\+Termination} (Mat\+Type \&V, size\+\_\+t num\+\_\+test\+\_\+points, double tolerance=1e-\/5, size\+\_\+t max\+Iterations=10000, size\+\_\+t reverse\+Step\+Tolerance=3)
\begin{DoxyCompactList}\small\item\em Create a validation set according to given parameters and nullifies this set in data matrix(training set). \end{DoxyCompactList}\item 
const double \& \textbf{ Index} () const
\begin{DoxyCompactList}\small\item\em Get current value of residue. \end{DoxyCompactList}\item 
void \textbf{ Initialize} (const Mat\+Type \&)
\begin{DoxyCompactList}\small\item\em Initializes the termination policy before stating the factorization. \end{DoxyCompactList}\item 
bool \textbf{ Is\+Converged} (arma\+::mat \&W, arma\+::mat \&H)
\begin{DoxyCompactList}\small\item\em Check if termination criterio is met. \end{DoxyCompactList}\item 
const size\+\_\+t \& \textbf{ Iteration} () const
\begin{DoxyCompactList}\small\item\em Get current iteration count. \end{DoxyCompactList}\item 
const size\+\_\+t \& \textbf{ Max\+Iterations} () const
\begin{DoxyCompactList}\small\item\em Access upper limit of iteration count. \end{DoxyCompactList}\item 
size\+\_\+t \& \textbf{ Max\+Iterations} ()
\item 
const size\+\_\+t \& \textbf{ Num\+Test\+Points} () const
\begin{DoxyCompactList}\small\item\em Get number of validation points. \end{DoxyCompactList}\item 
const double \& \textbf{ Tolerance} () const
\begin{DoxyCompactList}\small\item\em Access tolerance value. \end{DoxyCompactList}\item 
double \& \textbf{ Tolerance} ()
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class Mat\+Type$>$\newline
class mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination$<$ Mat\+Type $>$}

This class implements validation termination policy based on R\+M\+SE index. 

The input data matrix is divided into 2 sets, training set and validation set. Entries of validation set are nullifed in the input matrix. Termination criterion is met when increase in validation set R\+M\+Se value drops below the given tolerance. To accommodate spikes certain number of successive validation R\+M\+SE drops are accepted. This upper imit on successive drops can be adjusted with reverse\+Step\+Count. Secondary termination criterion terminates algorithm when iteration count goes above the threshold.

\begin{DoxyNote}{Note}
The input matrix is modified by this termination policy.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\doxyref{A\+MF}{p.}{classmlpack_1_1amf_1_1AMF} 
\end{DoxySeeAlso}


Definition at line 37 of file validation\+\_\+rmse\+\_\+termination.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a0b35fd2a73bdd8b0f6e0655118ac7197}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Validation\+R\+M\+S\+E\+Termination@{Validation\+R\+M\+S\+E\+Termination}}
\index{Validation\+R\+M\+S\+E\+Termination@{Validation\+R\+M\+S\+E\+Termination}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Validation\+R\+M\+S\+E\+Termination()}
{\footnotesize\ttfamily \textbf{ Validation\+R\+M\+S\+E\+Termination} (\begin{DoxyParamCaption}\item[{Mat\+Type \&}]{V,  }\item[{size\+\_\+t}]{num\+\_\+test\+\_\+points,  }\item[{double}]{tolerance = {\ttfamily 1e-\/5},  }\item[{size\+\_\+t}]{max\+Iterations = {\ttfamily 10000},  }\item[{size\+\_\+t}]{reverse\+Step\+Tolerance = {\ttfamily 3} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create a validation set according to given parameters and nullifies this set in data matrix(training set). 


\begin{DoxyParams}{Parameters}
{\em V} & Input matrix to be factorized. \\
\hline
{\em num\+\_\+test\+\_\+points} & number of validation test points \\
\hline
{\em max\+Iterations} & max iteration count before termination \\
\hline
{\em reverse\+Step\+Tolerance} & max successive R\+M\+SE drops allowed \\
\hline
\end{DoxyParams}


Definition at line 49 of file validation\+\_\+rmse\+\_\+termination.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a866b70f9202a81d2bdbb116bc2683eb2}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Index@{Index}}
\index{Index@{Index}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Index()}
{\footnotesize\ttfamily const double\& Index (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get current value of residue. 



Definition at line 187 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_acbaed082d0525430f3a66296b54c11e7}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Initialize()}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initializes the termination policy before stating the factorization. 


\begin{DoxyParams}{Parameters}
{\em V} & Input matrix to be factorized. \\
\hline
\end{DoxyParams}


Definition at line 94 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a21aa00d1db37e94076e46c66313514df}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Is\+Converged@{Is\+Converged}}
\index{Is\+Converged@{Is\+Converged}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Is\+Converged()}
{\footnotesize\ttfamily bool Is\+Converged (\begin{DoxyParamCaption}\item[{arma\+::mat \&}]{W,  }\item[{arma\+::mat \&}]{H }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Check if termination criterio is met. 


\begin{DoxyParams}{Parameters}
{\em W} & Basis matrix of output. \\
\hline
{\em H} & Encoding matrix of output. \\
\hline
\end{DoxyParams}


Definition at line 114 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a5226c80136390904f5893e72749211e6}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Iteration@{Iteration}}
\index{Iteration@{Iteration}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Iteration()}
{\footnotesize\ttfamily const size\+\_\+t\& Iteration (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get current iteration count. 



Definition at line 190 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a26b939a18b15788ad266b8eda3f301e6}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Max\+Iterations()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const size\+\_\+t\& Max\+Iterations (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Access upper limit of iteration count. 



Definition at line 196 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_acda675ab4ab86b95c92bc33bc391a61b}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Max\+Iterations()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily size\+\_\+t\& Max\+Iterations (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 197 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a8a782fdac137e9d2c9de49fb5a529391}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Num\+Test\+Points@{Num\+Test\+Points}}
\index{Num\+Test\+Points@{Num\+Test\+Points}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Num\+Test\+Points()}
{\footnotesize\ttfamily const size\+\_\+t\& Num\+Test\+Points (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get number of validation points. 



Definition at line 193 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_aa3141c2547caeb826a4c221e10b8529e}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Tolerance@{Tolerance}}
\index{Tolerance@{Tolerance}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Tolerance()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const double\& Tolerance (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Access tolerance value. 



Definition at line 200 of file validation\+\_\+rmse\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1ValidationRMSETermination_a3d9fac84af16250f5a3689692e8f2173}} 
\index{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}!Tolerance@{Tolerance}}
\index{Tolerance@{Tolerance}!mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination@{mlpack\+::amf\+::\+Validation\+R\+M\+S\+E\+Termination}}
\subsubsection{Tolerance()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Tolerance (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Definition at line 201 of file validation\+\_\+rmse\+\_\+termination.\+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/termination\+\_\+policies/\textbf{ validation\+\_\+rmse\+\_\+termination.\+hpp}\end{DoxyCompactItemize}
