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 size_t & Iteration() const
Get current iteration count.
Definition: simple_residue_termination.hpp:101
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
double residue
current value of residue
Definition: simple_residue_termination.hpp:118
The core includes that mlpack expects; standard C++ includes and Armadillo.
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...
Definition: simple_residue_termination.hpp:42
This class implements a simple residue-based termination policy.
Definition: simple_residue_termination.hpp:31
double normOld
norm of previous iteration
Definition: simple_residue_termination.hpp:122
size_t maxIterations
iteration threshold
Definition: simple_residue_termination.hpp:115
const size_t & MaxIterations() const
Access max iteration count.
Definition: simple_residue_termination.hpp:104
bool IsConverged(arma::mat &W, arma::mat &H)
Check if termination criterion is met.
Definition: simple_residue_termination.hpp:76
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
Definition: log.hpp:84
const double & MinResidue() const
Access minimum residue value.
Definition: simple_residue_termination.hpp:108
const double & Index() const
Get current value of residue.
Definition: simple_residue_termination.hpp:98
void Initialize(const MatType &V)
Initializes the termination policy before stating the factorization.
Definition: simple_residue_termination.hpp:60
double minResidue
residue threshold
Definition: simple_residue_termination.hpp:113
size_t iteration
current iteration count
Definition: simple_residue_termination.hpp:120