mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::amf::MaxIterationTermination Class Reference

This termination policy only terminates when the maximum number of iterations has been reached. More...

Public Member Functions

 MaxIterationTermination (const size_t maxIterations)
 Construct the termination policy with the given number of iterations allowed (default 1000). More...
 
size_t Index ()
 Return something similar to the residue, which in this case is just the number of iterations left, since we don't have access to anything else. More...
 
template<typename MatType >
void Initialize (const MatType &)
 Initialize for the given matrix V (there is nothing to do). More...
 
bool IsConverged (const arma::mat &, const arma::mat &)
 Check if convergence has occurred. More...
 
size_t Iteration () const
 Get the current iteration. More...
 
size_t & Iteration ()
 Modify the current iteration. More...
 
size_t MaxIterations () const
 Get the maximum number of iterations. More...
 
size_t & MaxIterations ()
 Modify the maximum number of iterations. More...
 

Private Attributes

size_t iteration
 The number of the current iteration. More...
 
size_t maxIterations
 The maximum number of allowed iterations. More...
 

Detailed Description

This termination policy only terminates when the maximum number of iterations has been reached.

Definition at line 23 of file max_iteration_termination.hpp.

Constructor & Destructor Documentation

mlpack::amf::MaxIterationTermination::MaxIterationTermination ( const size_t  maxIterations)
inline

Construct the termination policy with the given number of iterations allowed (default 1000).

If maxIterations is 0, then termination will never occur.

Parameters
maxIterationsMaximum number of allowed iterations.

Definition at line 33 of file max_iteration_termination.hpp.

References mlpack::Log::Warn.

Member Function Documentation

size_t mlpack::amf::MaxIterationTermination::Index ( )
inline

Return something similar to the residue, which in this case is just the number of iterations left, since we don't have access to anything else.

Definition at line 60 of file max_iteration_termination.hpp.

References iteration, and maxIterations.

template<typename MatType >
void mlpack::amf::MaxIterationTermination::Initialize ( const MatType &  )
inline

Initialize for the given matrix V (there is nothing to do).

Definition at line 47 of file max_iteration_termination.hpp.

bool mlpack::amf::MaxIterationTermination::IsConverged ( const arma::mat &  ,
const arma::mat &   
)
inline

Check if convergence has occurred.

Definition at line 52 of file max_iteration_termination.hpp.

References iteration, and maxIterations.

size_t mlpack::amf::MaxIterationTermination::Iteration ( ) const
inline

Get the current iteration.

Definition at line 66 of file max_iteration_termination.hpp.

References iteration.

size_t& mlpack::amf::MaxIterationTermination::Iteration ( )
inline

Modify the current iteration.

Definition at line 68 of file max_iteration_termination.hpp.

References iteration.

size_t mlpack::amf::MaxIterationTermination::MaxIterations ( ) const
inline

Get the maximum number of iterations.

Definition at line 71 of file max_iteration_termination.hpp.

References maxIterations.

size_t& mlpack::amf::MaxIterationTermination::MaxIterations ( )
inline

Modify the maximum number of iterations.

Definition at line 73 of file max_iteration_termination.hpp.

References maxIterations.

Member Data Documentation

size_t mlpack::amf::MaxIterationTermination::iteration
private

The number of the current iteration.

Definition at line 79 of file max_iteration_termination.hpp.

Referenced by Index(), IsConverged(), and Iteration().

size_t mlpack::amf::MaxIterationTermination::maxIterations
private

The maximum number of allowed iterations.

Definition at line 77 of file max_iteration_termination.hpp.

Referenced by Index(), IsConverged(), and MaxIterations().


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