\section{Simple\+Tolerance\+Termination$<$ Mat\+Type $>$ Class Template Reference}
\label{classmlpack_1_1amf_1_1SimpleToleranceTermination}\index{Simple\+Tolerance\+Termination$<$ Mat\+Type $>$@{Simple\+Tolerance\+Termination$<$ Mat\+Type $>$}}


This class implements residue tolerance termination policy.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Simple\+Tolerance\+Termination} (const double tolerance=1e-\/5, const size\+\_\+t max\+Iterations=10000, const size\+\_\+t reverse\+Step\+Tolerance=3)
\begin{DoxyCompactList}\small\item\em empty constructor \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 \&V)
\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 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\+::\+Simple\+Tolerance\+Termination$<$ Mat\+Type $>$}

This class implements residue tolerance termination policy. 

Termination criterion is met when increase in residue value drops below the given tolerance. To accommodate spikes certain number of successive residue 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{DoxySeeAlso}{See also}
\doxyref{A\+MF}{p.}{classmlpack_1_1amf_1_1AMF} 
\end{DoxySeeAlso}


Definition at line 31 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a8b485eec7b56aa4526a9c3749fd204dc}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Simple\+Tolerance\+Termination@{Simple\+Tolerance\+Termination}}
\index{Simple\+Tolerance\+Termination@{Simple\+Tolerance\+Termination}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}}
\subsubsection{Simple\+Tolerance\+Termination()}
{\footnotesize\ttfamily \textbf{ Simple\+Tolerance\+Termination} (\begin{DoxyParamCaption}\item[{const double}]{tolerance = {\ttfamily 1e-\/5},  }\item[{const size\+\_\+t}]{max\+Iterations = {\ttfamily 10000},  }\item[{const size\+\_\+t}]{reverse\+Step\+Tolerance = {\ttfamily 3} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



empty constructor 



Definition at line 35 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a866b70f9202a81d2bdbb116bc2683eb2}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Index@{Index}}
\index{Index@{Index}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 149 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a60bfe6387760b1d86552cce461d23099}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Initialize@{Initialize}}
\index{Initialize@{Initialize}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}}
\subsubsection{Initialize()}
{\footnotesize\ttfamily void Initialize (\begin{DoxyParamCaption}\item[{const Mat\+Type \&}]{V }\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 47 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a21aa00d1db37e94076e46c66313514df}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Is\+Converged@{Is\+Converged}}
\index{Is\+Converged@{Is\+Converged}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 69 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.



References Log\+::\+Info.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a5226c80136390904f5893e72749211e6}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Iteration@{Iteration}}
\index{Iteration@{Iteration}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 152 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a26b939a18b15788ad266b8eda3f301e6}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 155 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_acda675ab4ab86b95c92bc33bc391a61b}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Max\+Iterations@{Max\+Iterations}}
\index{Max\+Iterations@{Max\+Iterations}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 156 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_aa3141c2547caeb826a4c221e10b8529e}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Tolerance@{Tolerance}}
\index{Tolerance@{Tolerance}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 159 of file simple\+\_\+tolerance\+\_\+termination.\+hpp.

\mbox{\label{classmlpack_1_1amf_1_1SimpleToleranceTermination_a3d9fac84af16250f5a3689692e8f2173}} 
\index{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+Termination}!Tolerance@{Tolerance}}
\index{Tolerance@{Tolerance}!mlpack\+::amf\+::\+Simple\+Tolerance\+Termination@{mlpack\+::amf\+::\+Simple\+Tolerance\+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 160 of file simple\+\_\+tolerance\+\_\+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.\+2/src/mlpack/methods/amf/termination\+\_\+policies/\textbf{ simple\+\_\+tolerance\+\_\+termination.\+hpp}\end{DoxyCompactItemize}
