CompleteIncrementalTermination< TerminationPolicy > Class Template Reference

This class acts as a wrapper for basic termination policies to be used by SVDCompleteIncrementalLearning. More...

Public Member Functions

 CompleteIncrementalTermination (TerminationPolicy tPolicy=TerminationPolicy())
 Empty constructor. More...

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

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

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

 
bool IsConverged (arma::mat &W, arma::mat &H)
 Check if termination criterion is met, if the current iteration means that each point has been visited. 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 ()
 Modify maximum number of iterations. More...

 
const TerminationPolicy & TPolicy () const
 Access the wrapped termination policy. More...

 
TerminationPolicy & TPolicy ()
 Modify the wrapped termination policy. More...

 

Detailed Description


template
<
class
TerminationPolicy
>

class mlpack::amf::CompleteIncrementalTermination< TerminationPolicy >

This class acts as a wrapper for basic termination policies to be used by SVDCompleteIncrementalLearning.

This class calls the wrapped class functions after every n calls to main class functions where n is the number of non-zero entries in the matrix being factorized. This is necessary for SVDCompleteIncrementalLearning, because otherwise IsConverged() is called after every point, which is very slow.

See also
AMF, SVDCompleteIncrementalLearning

Definition at line 29 of file complete_incremental_termination.hpp.

Constructor & Destructor Documentation

◆ CompleteIncrementalTermination()

CompleteIncrementalTermination ( TerminationPolicy  tPolicy = TerminationPolicy())
inline

Empty constructor.

Parameters
tPolicyobject of wrapped class.

Definition at line 37 of file complete_incremental_termination.hpp.

Member Function Documentation

◆ Index()

const double& Index ( ) const
inline

Get current value of residue.

Definition at line 93 of file complete_incremental_termination.hpp.

◆ Initialize() [1/2]

void Initialize ( const MatType &  V)
inline

Initializes the termination policy before stating the factorization.

Parameters
VInput matrix to be factorized.

Definition at line 48 of file complete_incremental_termination.hpp.

◆ Initialize() [2/2]

void Initialize ( const arma::sp_mat &  V)
inline

Initializes the termination policy before stating the factorization.

This is a specialization for sparse matrices.

Parameters
VInput matrix to be factorized.

Definition at line 63 of file complete_incremental_termination.hpp.

◆ IsConverged()

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

Check if termination criterion is met, if the current iteration means that each point has been visited.

Parameters
WBasis matrix of output.
HEncoding matrix of output.

Definition at line 79 of file complete_incremental_termination.hpp.

◆ Iteration()

const size_t& Iteration ( ) const
inline

Get current iteration count.

Definition at line 96 of file complete_incremental_termination.hpp.

◆ MaxIterations() [1/2]

const size_t& MaxIterations ( ) const
inline

Access upper limit of iteration count.

Definition at line 99 of file complete_incremental_termination.hpp.

◆ MaxIterations() [2/2]

size_t& MaxIterations ( )
inline

Modify maximum number of iterations.

Definition at line 101 of file complete_incremental_termination.hpp.

◆ TPolicy() [1/2]

const TerminationPolicy& TPolicy ( ) const
inline

Access the wrapped termination policy.

Definition at line 104 of file complete_incremental_termination.hpp.

◆ TPolicy() [2/2]

TerminationPolicy& TPolicy ( )
inline

Modify the wrapped termination policy.

Definition at line 106 of file complete_incremental_termination.hpp.


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