shark::AbstractStoppingCriterion< ResultSetT > Class Template Referenceabstract

Base class for stopping criteria of optimization algorithms. More...

#include <shark/Algorithms/StoppingCriteria/AbstractStoppingCriterion.h>

+ Inheritance diagram for shark::AbstractStoppingCriterion< ResultSetT >:

Public Types

typedef ResultSetT ResultSet
 

Public Member Functions

virtual void reset ()=0
 resets the internal state. call before a new trial
 
virtual bool stop (ResultSet const &set)=0
 

Detailed Description

template<class ResultSetT>
class shark::AbstractStoppingCriterion< ResultSetT >

Base class for stopping criteria of optimization algorithms.

Each stopping criterion provides a stop method which takes as argument the latest result of an optimization algorithm. This result is passed as a ResultSetT, which is a template type of this interface. In actual implementations, that type will usually hold the latest objective function value reached by the optimizer on the training set, but may also additionally encapsulate a performance value reached on a validation set. The stopping criteria may then use this information to reach their characteristic decision of whether or not stopping the optimization process is indicated or not.

Definition at line 51 of file AbstractStoppingCriterion.h.

Member Typedef Documentation

◆ ResultSet

template<class ResultSetT >
typedef ResultSetT shark::AbstractStoppingCriterion< ResultSetT >::ResultSet

Definition at line 53 of file AbstractStoppingCriterion.h.

Member Function Documentation

◆ reset()

◆ stop()

template<class ResultSetT >
virtual bool shark::AbstractStoppingCriterion< ResultSetT >::stop ( ResultSet const &  set)
pure virtual

after an iteration, updates the internal state and checks whether the algorithm should stop

Parameters
setthe result of the current iteration

Implemented in shark::MaxIterations< ResultSet >, and shark::ValidatedStoppingCriterion.

Referenced by shark::ValidatedStoppingCriterion::stop(), and shark::OptimizationTrainer< Model, LabelTypeT >::train().


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