shark::TrainingProgress< PointType > Class Template Reference

This stopping criterion tracks the improvement of the training error over an interval of iterations. More...

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

+ Inheritance diagram for shark::TrainingProgress< PointType >:

Public Types

typedef SingleObjectiveResultSet< PointType > ResultSet
 
- Public Types inherited from shark::AbstractStoppingCriterion< SingleObjectiveResultSet< PointType > >
typedef SingleObjectiveResultSet< PointType > ResultSet
 

Public Member Functions

 TrainingProgress (size_t intervalSize, double minImprovement)
 
bool stop (const ResultSet &set)
 returns true if training should stop More...
 
void reset ()
 resets the internal state More...
 
double value () const
 returns current value of progress More...
 

Protected Attributes

double m_minTraining
 minimum training error encountered More...
 
double m_minImprovement
 minimum improvement allowed before training stops More...
 
double m_meanPerformance
 mean performance over the last intervalSize timesteps More...
 
double m_progress
 current progress measure. if it is below minTraining, stop() will return true More...
 
std::queue< double > m_interval
 current interval More...
 
size_t m_intervalSize
 size of the interval More...
 

Detailed Description

template<class PointType = RealVector>
class shark::TrainingProgress< PointType >

This stopping criterion tracks the improvement of the training error over an interval of iterations.

If the mean performance over this strip divided by the minimum is too low, training is stopped. The difference to TrainingError is, that this class tests the relative improvement of the error compared to the minimum training error, while the TrainingError measures the absolute difference. This class is a bit better tuned to noisy error functions since it takes the mean of the interval as comparison.

Terminology for this and other stopping criteria is taken from (and also see):

Lutz Prechelt. Early Stopping - but when? In Genevieve B. Orr and Klaus-Robert Müller: Neural Networks: Tricks of the Trade, volume 1524 of LNCS, Springer, 1997.

Definition at line 59 of file TrainingProgress.h.

Member Typedef Documentation

◆ ResultSet

template<class PointType = RealVector>
typedef SingleObjectiveResultSet<PointType> shark::TrainingProgress< PointType >::ResultSet

Definition at line 61 of file TrainingProgress.h.

Constructor & Destructor Documentation

◆ TrainingProgress()

template<class PointType = RealVector>
shark::TrainingProgress< PointType >::TrainingProgress ( size_t  intervalSize,
double  minImprovement 
)
inline

constructs the TrainingProgress

Parameters
intervalSizethe size of the interval which is checked
minImprovementminimum relative improvement of the interval to the minimum training error before training stops

Definition at line 65 of file TrainingProgress.h.

References shark::TrainingProgress< PointType >::m_intervalSize, shark::TrainingProgress< PointType >::m_minImprovement, and shark::TrainingProgress< PointType >::reset().

Member Function Documentation

◆ reset()

◆ stop()

template<class PointType = RealVector>
bool shark::TrainingProgress< PointType >::stop ( const ResultSet set)
inlinevirtual

◆ value()

template<class PointType = RealVector>
double shark::TrainingProgress< PointType >::value ( ) const
inline

returns current value of progress

Definition at line 97 of file TrainingProgress.h.

References shark::TrainingProgress< PointType >::m_progress.

Member Data Documentation

◆ m_interval

template<class PointType = RealVector>
std::queue<double> shark::TrainingProgress< PointType >::m_interval
protected

current interval

Definition at line 111 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::reset().

◆ m_intervalSize

template<class PointType = RealVector>
size_t shark::TrainingProgress< PointType >::m_intervalSize
protected

size of the interval

Definition at line 113 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::TrainingProgress().

◆ m_meanPerformance

template<class PointType = RealVector>
double shark::TrainingProgress< PointType >::m_meanPerformance
protected

mean performance over the last intervalSize timesteps

Definition at line 106 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::reset().

◆ m_minImprovement

template<class PointType = RealVector>
double shark::TrainingProgress< PointType >::m_minImprovement
protected

minimum improvement allowed before training stops

Definition at line 104 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::TrainingProgress().

◆ m_minTraining

template<class PointType = RealVector>
double shark::TrainingProgress< PointType >::m_minTraining
protected

minimum training error encountered

Definition at line 102 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::reset(), and shark::TrainingProgress< PointType >::stop().

◆ m_progress

template<class PointType = RealVector>
double shark::TrainingProgress< PointType >::m_progress
protected

current progress measure. if it is below minTraining, stop() will return true

Definition at line 108 of file TrainingProgress.h.

Referenced by shark::TrainingProgress< PointType >::reset(), and shark::TrainingProgress< PointType >::value().


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