shark::TrainingError< PointType > Class Template Reference

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

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

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

Public Member Functions

 TrainingError (size_t intervalSize, double minDifference)
 
bool stop (const SingleObjectiveResultSet< PointType > &set)
 returns true if training should stop More...
 
void reset ()
 resets the internal state More...
 

Protected Attributes

std::queue< double > m_interval
 monitored training interval More...
 
double m_minDifference
 minmum difference allowed More...
 
size_t m_intervalSize
 size of the interval More...
 

Additional Inherited Members

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

Detailed Description

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

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

If at one point, the difference between the error values of the beginning and the end of the interval are smaller than a certain value, this stopping criterion assumes convergence and stops. Of course, this may be misleading, when the algorithm temporarily gets stuck at a saddle point of the error surface. The functions assumes that the algorithm is minimizing. For details, 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 55 of file TrainingError.h.

Constructor & Destructor Documentation

◆ TrainingError()

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

constructs the TrainingError generalization loss

Parameters
intervalSizesize of the interval over which the progress is monitored
minDifferenceminimum difference between start and end of the interval allowed before training stops

Definition at line 60 of file TrainingError.h.

References shark::TrainingError< PointType >::m_intervalSize, shark::TrainingError< PointType >::m_minDifference, and shark::TrainingError< PointType >::reset().

Member Function Documentation

◆ reset()

template<class PointType = RealVector>
void shark::TrainingError< PointType >::reset ( )
inlinevirtual

◆ stop()

template<class PointType = RealVector>
bool shark::TrainingError< PointType >::stop ( const SingleObjectiveResultSet< PointType > &  set)
inlinevirtual

Member Data Documentation

◆ m_interval

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

monitored training interval

Definition at line 82 of file TrainingError.h.

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

◆ m_intervalSize

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

size of the interval

Definition at line 86 of file TrainingError.h.

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

◆ m_minDifference

template<class PointType = RealVector>
double shark::TrainingError< PointType >::m_minDifference
protected

minmum difference allowed

Definition at line 84 of file TrainingError.h.

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


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