22 #ifndef _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 23 #define _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 61 template<
typename MatType>
67 nm = V.n_rows * V.n_cols;
81 const double norm = arma::norm(W * H,
"fro");
128 #endif // _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED
const double & Index() const
Get current value of residue.
Linear algebra utility functions, generally performed on matrices or vectors.
double residue
current value of residue
const double & MinResidue() const
Access minimum residue value.
This class implements a simple residue-based termination policy.
const size_t & Iteration() const
Get current iteration count.
double normOld
norm of previous iteration
size_t maxIterations
iteration threshold
bool IsConverged(arma::mat &W, arma::mat &H)
Check if termination criterion is met.
const size_t & MaxIterations() const
Access max iteration count.
SimpleResidueTermination(const double minResidue=1e-10, const size_t maxIterations=10000)
Construct the SimpleResidueTermination object with the given minimum residue (or the default) and the...
void Initialize(const MatType &V)
Initializes the termination policy before stating the factorization.
double minResidue
residue threshold
size_t iteration
current iteration count