12 #ifndef _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 13 #define _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED 59 template<
typename MatType>
65 nm = V.n_rows * V.n_cols;
81 for (
size_t j = 0; j < H.n_cols; ++j)
82 norm += arma::norm(W * H.col(j),
"fro");
131 #endif // _MLPACK_METHODS_AMF_SIMPLERESIDUETERMINATION_HPP_INCLUDED const double & Index() const
Get current value of residue.
double normOld
norm of previous iteration
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...
size_t maxIterations
iteration threshold
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
This class implements a simple residue-based termination policy.
void Initialize(const MatType &V)
Initializes the termination policy before stating the factorization.
double minResidue
residue threshold
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
bool IsConverged(arma::mat &W, arma::mat &H)
Check if termination criterion is met.
double residue
current value of residue
const size_t & Iteration() const
Get current iteration count.
const double & MinResidue() const
Access minimum residue value.
size_t iteration
current iteration count
const size_t & MaxIterations() const
Access max iteration count.