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>
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 |
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.
|
inline |
constructs the TrainingError generalization loss
intervalSize | size of the interval over which the progress is monitored |
minDifference | minimum 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().
|
inlinevirtual |
resets the internal state
Implements shark::AbstractStoppingCriterion< SingleObjectiveResultSet< PointType > >.
Definition at line 74 of file TrainingError.h.
References shark::TrainingError< PointType >::m_interval, and shark::TrainingError< PointType >::m_intervalSize.
Referenced by shark::TrainingError< PointType >::TrainingError().
|
inlinevirtual |
returns true if training should stop
Implements shark::AbstractStoppingCriterion< SingleObjectiveResultSet< PointType > >.
Definition at line 66 of file TrainingError.h.
References shark::TrainingError< PointType >::m_interval, and shark::TrainingError< PointType >::m_minDifference.
|
protected |
monitored training interval
Definition at line 82 of file TrainingError.h.
Referenced by shark::TrainingError< PointType >::reset(), and shark::TrainingError< PointType >::stop().
|
protected |
size of the interval
Definition at line 86 of file TrainingError.h.
Referenced by shark::TrainingError< PointType >::reset(), and shark::TrainingError< PointType >::TrainingError().
|
protected |
minmum difference allowed
Definition at line 84 of file TrainingError.h.
Referenced by shark::TrainingError< PointType >::stop(), and shark::TrainingError< PointType >::TrainingError().