mlpack  2.2.5
SimpleToleranceTermination< MatType > Class Template Reference

This class implements residue tolerance termination policy. More...

Public Member Functions

 SimpleToleranceTermination (const double tolerance=1e-5, const size_t maxIterations=10000, const size_t reverseStepTolerance=3)
 empty constructor More...

 
const double & Index () const
 Get current value of residue. More...

 
void Initialize (const MatType &V)
 Initializes the termination policy before stating the factorization. More...

 
bool IsConverged (arma::mat &W, arma::mat &H)
 Check if termination criterio is met. More...

 
const size_t & Iteration () const
 Get current iteration count. More...

 
const size_t & MaxIterations () const
 Access upper limit of iteration count. More...

 
size_t & MaxIterations ()
 
const double & Tolerance () const
 Access tolerance value. More...

 
double & Tolerance ()
 

Detailed Description


template
<
class
MatType
>

class mlpack::amf::SimpleToleranceTermination< MatType >

This class implements residue tolerance termination policy.

Termination criterion is met when increase in residue value drops below the given tolerance. To accommodate spikes certain number of successive residue drops are accepted. This upper imit on successive drops can be adjusted with reverseStepCount. Secondary termination criterion terminates algorithm when iteration count goes above the threshold.

See also
AMF

Definition at line 31 of file simple_tolerance_termination.hpp.

Constructor & Destructor Documentation

◆ SimpleToleranceTermination()

SimpleToleranceTermination ( const double  tolerance = 1e-5,
const size_t  maxIterations = 10000,
const size_t  reverseStepTolerance = 3 
)
inline

empty constructor

Definition at line 35 of file simple_tolerance_termination.hpp.

Member Function Documentation

◆ Index()

const double& Index ( ) const
inline

Get current value of residue.

Definition at line 149 of file simple_tolerance_termination.hpp.

◆ Initialize()

void Initialize ( const MatType &  V)
inline

Initializes the termination policy before stating the factorization.

Parameters
VInput matrix to be factorized.

Definition at line 47 of file simple_tolerance_termination.hpp.

◆ IsConverged()

bool IsConverged ( arma::mat &  W,
arma::mat &  H 
)
inline

Check if termination criterio is met.

Parameters
WBasis matrix of output.
HEncoding matrix of output.

Definition at line 69 of file simple_tolerance_termination.hpp.

References Log::Info.

◆ Iteration()

const size_t& Iteration ( ) const
inline

Get current iteration count.

Definition at line 152 of file simple_tolerance_termination.hpp.

◆ MaxIterations() [1/2]

const size_t& MaxIterations ( ) const
inline

Access upper limit of iteration count.

Definition at line 155 of file simple_tolerance_termination.hpp.

◆ MaxIterations() [2/2]

size_t& MaxIterations ( )
inline

Definition at line 156 of file simple_tolerance_termination.hpp.

◆ Tolerance() [1/2]

const double& Tolerance ( ) const
inline

Access tolerance value.

Definition at line 159 of file simple_tolerance_termination.hpp.

◆ Tolerance() [2/2]

double& Tolerance ( )
inline

Definition at line 160 of file simple_tolerance_termination.hpp.


The documentation for this class was generated from the following file: