12 #ifndef _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 13 #define _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 51 template<
typename MatType>
57 nm = V.n_rows * V.n_cols;
73 for (
size_t j = 0; j < H.n_cols; ++j)
74 norm += arma::norm(W * H.col(j),
"fro");
122 #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
The core includes that mlpack expects; standard C++ includes and Armadillo.
const double & MinResidue() const
Access minimum residue value.
SimpleResidueTermination(const double minResidue=1e-5, const size_t maxIterations=10000)
Construct the SimpleResidueTermination object with the given minimum residue (or the default) and the...
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.
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
const size_t & MaxIterations() const
Access max iteration count.
void Initialize(const MatType &V)
Initializes the termination policy before stating the factorization.
double minResidue
residue threshold
size_t iteration
current iteration count