13 #ifndef MLPACK_METHODS_AMF_TERMINATION_POLICIES_MAX_ITERATION_TERMINATION_HPP 14 #define MLPACK_METHODS_AMF_TERMINATION_POLICIES_MAX_ITERATION_TERMINATION_HPP 34 maxIterations(maxIterations),
37 if (maxIterations == 0)
38 Log::Warn <<
"MaxIterationTermination::MaxIterationTermination(): given " 39 <<
"number of iterations is 0, so algorithm will never terminate!" 46 template<
typename MatType>
size_t Iteration() const
Get the current iteration.
Linear algebra utility functions, generally performed on matrices or vectors.
void Initialize(const MatType &)
Initialize for the given matrix V (there is nothing to do).
size_t maxIterations
The maximum number of allowed iterations.
static MLPACK_EXPORT util::PrefixedOutStream Warn
Prints warning messages prefixed with [WARN ].
bool IsConverged(const arma::mat &, const arma::mat &)
Check if convergence has occurred.
size_t Index()
Return something similar to the residue, which in this case is just the number of iterations left...
size_t MaxIterations() const
Get the maximum number of iterations.
This termination policy only terminates when the maximum number of iterations has been reached...
MaxIterationTermination(const size_t maxIterations)
Construct the termination policy with the given number of iterations allowed (default 1000)...
size_t & Iteration()
Modify the current iteration.
size_t & MaxIterations()
Modify the maximum number of iterations.
size_t iteration
The number of the current iteration.