|
template<typename T > |
static void | callMethod (std::shared_ptr< T > callback, const std::string &methodName, Model &model) |
| Calls the method of the callback with the given logs.
|
|
static void | checkMetric (const std::string &metric, const std::vector< std::string > &metrics) |
|
static std::unordered_map< std::string, Logs > | getLogs (Model &model) |
|
◆ EarlyStopping()
NeuralNet::EarlyStopping::EarlyStopping |
( |
const std::string & | metric = "LOSS", |
|
|
double | minDelta = 0, |
|
|
int | patience = 0 ) |
|
inline |
EarlyStopping is a Callback
that stops training when a monitored metric has stopped improving.
- Parameters
-
metric | The metric to monitor (default: LOSS ) |
minDelta | Minimum change in the monitored quantity to qualify as an improvement, i.e. an absolute change of less than minDelta, will count as no improvement. (default: 0) |
patience | Number of epochs with no improvement after which training will be stopped. (default: 0) |
◆ onBatchBegin()
void NeuralNet::EarlyStopping::onBatchBegin |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
◆ onBatchEnd()
void NeuralNet::EarlyStopping::onBatchEnd |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
◆ onEpochBegin()
void NeuralNet::EarlyStopping::onEpochBegin |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
◆ onEpochEnd()
void NeuralNet::EarlyStopping::onEpochEnd |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
This method will be called at the end of each epoch.
- Parameters
-
epoch | The current epoch |
logs | The logs of the current epoch |
- Returns
- Returns true if the training should continue otherwise returns false
- Warning
- The order of the logs should be the same as the order of the metrics.
Implements NeuralNet::Callback.
◆ onTrainBegin()
void NeuralNet::EarlyStopping::onTrainBegin |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
◆ onTrainEnd()
void NeuralNet::EarlyStopping::onTrainEnd |
( |
Model & | model | ) |
|
|
inlineoverridevirtual |
The documentation for this class was generated from the following file: