12 #ifndef _MLPACK_METHODS_AMF_SIMPLE_TOLERANCE_TERMINATION_HPP_INCLUDED 13 #define _MLPACK_METHODS_AMF_SIMPLE_TOLERANCE_TERMINATION_HPP_INCLUDED 30 template <
class MatType>
81 for(
size_t i = 0;i < n;i++)
83 for(
size_t j = 0;j < m;j++)
86 if ((temp = (*
V)(i,j)) != 0)
88 temp = (temp - WH(i, j));
198 #endif // _MLPACK_METHODS_AMF_SIMPLE_TOLERANCE_TERMINATION_HPP_INCLUDED Linear algebra utility functions, generally performed on matrices or vectors.
size_t reverseStepCount
successive residue drops
const size_t & Iteration() const
Get current iteration count.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t iteration
current iteration count
double tolerance
tolerance
SimpleToleranceTermination(const double tolerance=1e-5, const size_t maxIterations=10000, const size_t reverseStepTolerance=3)
empty constructor
const MatType * V
pointer to matrix being factorized
bool isCopy
indicates whether a copy of information is available which corresponds to minimum residue point ...
arma::mat W
variables to store information of minimum residue poi
size_t reverseStepTolerance
tolerance on successive residue drops
const double & Index() const
Get current value of residue.
size_t maxIterations
iteration threshold
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
This class implements residue tolerance termination policy.
void Initialize(const MatType &V)
Initializes the termination policy before stating the factorization.
bool IsConverged(arma::mat &W, arma::mat &H)
Check if termination criterio is met.
double residueOld
residue values
const double & Tolerance() const
Access tolerance value.
const size_t & MaxIterations() const
Access upper limit of iteration count.