This stopping criterion tracks the improvement of the training error over an interval of iterations. More...
#include <shark/Algorithms/StoppingCriteria/TrainingProgress.h>
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... | |
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.
typedef SingleObjectiveResultSet<PointType> shark::TrainingProgress< PointType >::ResultSet |
Definition at line 61 of file TrainingProgress.h.
|
inline |
constructs the TrainingProgress
intervalSize | the size of the interval which is checked |
minImprovement | minimum 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().
|
inlinevirtual |
resets the internal state
Implements shark::AbstractStoppingCriterion< SingleObjectiveResultSet< PointType > >.
Definition at line 90 of file TrainingProgress.h.
References shark::TrainingProgress< PointType >::m_interval, shark::TrainingProgress< PointType >::m_meanPerformance, shark::TrainingProgress< PointType >::m_minTraining, and shark::TrainingProgress< PointType >::m_progress.
Referenced by shark::TrainingProgress< PointType >::TrainingProgress().
|
inlinevirtual |
returns true if training should stop
Implements shark::AbstractStoppingCriterion< SingleObjectiveResultSet< PointType > >.
Definition at line 71 of file TrainingProgress.h.
References shark::TrainingProgress< PointType >::m_minTraining.
|
inline |
returns current value of progress
Definition at line 97 of file TrainingProgress.h.
References shark::TrainingProgress< PointType >::m_progress.
|
protected |
current interval
Definition at line 111 of file TrainingProgress.h.
Referenced by shark::TrainingProgress< PointType >::reset().
|
protected |
size of the interval
Definition at line 113 of file TrainingProgress.h.
Referenced by shark::TrainingProgress< PointType >::TrainingProgress().
|
protected |
mean performance over the last intervalSize timesteps
Definition at line 106 of file TrainingProgress.h.
Referenced by shark::TrainingProgress< PointType >::reset().
|
protected |
minimum improvement allowed before training stops
Definition at line 104 of file TrainingProgress.h.
Referenced by shark::TrainingProgress< PointType >::TrainingProgress().
|
protected |
minimum training error encountered
Definition at line 102 of file TrainingProgress.h.
Referenced by shark::TrainingProgress< PointType >::reset(), and shark::TrainingProgress< PointType >::stop().
|
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().