#include <termination.h>
Inheritance diagram for Terminator:
Public Methods | |
Terminator (const PatternSet &validationset, int striplen) | |
bool | validate (const ANNetwork &net, Trainer &trainer, int cyclesTrained) |
virtual bool | restore (ANNetwork &net) |
double | generalizationLoss (double min=-666, double opt=-666) const |
double | validationError () const |
double | minimumError () const |
int | howManyTrained () const |
Protected Attributes | |
double | mMinValidError |
int | mMinCycle |
double | mLastValidError |
const PatternSet & | mValidationSet |
int | mStripLength |
The idea behing early stopping is as follows. When neural networks are trained with a training set, they often learn the training set so well that they "overfit" to it and start behaving badly with other patterns. With early stopping we try to stop the learning at the time when the networks starts to generalize badly. Generalization ability is tested with a separate validation set.
Terminates the subject when it is about to learn too much.
Definition at line 52 of file termination.h.
|
Standard constructor.
Definition at line 69 of file termination.cc. References mLastValidError, mMinCycle, and mMinValidError. |
|
Returns the current generalization loss (GL), OR calculates it for the given parameters, if given.
Definition at line 75 of file termination.cc. References mLastValidError, and mMinValidError. Referenced by Trainer::train(), and validate(). |
|
Returns the number of training cycles the network has been trained before the minimum validation error point.
Definition at line 103 of file termination.h. References mMinCycle. Referenced by Trainer::train(). |
|
Returns the lowest measured validation error.
Definition at line 98 of file termination.h. References mMinValidError. Referenced by Trainer::train(). |
|
Restores the network state state in Terminator::validate(). The most important implementor of this method is SavingTerminator::restore().
Reimplemented in SavingTerminator. Definition at line 84 of file termination.h. Referenced by Trainer::train(). |
|
Tests the networks with the validation set and returns 'true' if the training should be terminated. The Terminator::restore method should be called to restore the optimal network state.
Definition at line 82 of file termination.cc. References generalizationLoss(), mLastValidError, mValidationSet, Trainer::setGeneralizLoss(), and Learner::test(). Referenced by Trainer::train(). |
|
Returns the last measured validation error.
Definition at line 95 of file termination.h. References mLastValidError. Referenced by Trainer::train(). |
|
Last validation error.
Definition at line 113 of file termination.h. Referenced by generalizationLoss(), Terminator(), validate(), and validationError(). |
|
The number of training cycles at minimum.
Definition at line 110 of file termination.h. Referenced by howManyTrained(), SavingTerminator::save(), and Terminator(). |
|
Smalled validation error so far.
Definition at line 107 of file termination.h. Referenced by generalizationLoss(), minimumError(), and Terminator(). |
|
Validation interval.
Definition at line 119 of file termination.h. |
|
Validation pattern set.
Definition at line 116 of file termination.h. Referenced by validate(). |