NeuralNet 1.0
Loading...
Searching...
No Matches
NeuralNet::Callback Class Referenceabstract
Inheritance diagram for NeuralNet::Callback:
NeuralNet::CSVLogger NeuralNet::EarlyStopping NeuralNet::ModelCheckpoint

Public Member Functions

virtual void onTrainBegin (Model &model)=0
 
virtual void onTrainEnd (Model &model)=0
 
virtual void onEpochBegin (Model &model)=0
 
virtual void onEpochEnd (Model &model)=0
 
virtual void onBatchBegin (Model &model)=0
 
virtual void onBatchEnd (Model &model)=0
 

Static Public Member Functions

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 Protected Member Functions

static void checkMetric (const std::string &metric, const std::vector< std::string > &metrics)
 
static std::unordered_map< std::string, Logs > getLogs (Model &model)
 

Member Function Documentation

◆ callMethod()

template<typename T >
static void NeuralNet::Callback::callMethod ( std::shared_ptr< T > callback,
const std::string & methodName,
Model & model )
inlinestatic

Calls the method of the callback with the given logs.

Template Parameters
TThe type of the callback
Parameters
callbackA shared_ptr to the callback
methodNameThe name of the method to call (onTrainBegin, onTrainEnd, onEpochBegin, onEpochEnd, onBatchBegin, onBatchEnd)
logsThe logs to pass to the method
Warning
There should be consistency between the names of the logs and the metrics of the callbacks

◆ onEpochEnd()

virtual void NeuralNet::Callback::onEpochEnd ( Model & model)
pure virtual

◆ onTrainBegin()

virtual void NeuralNet::Callback::onTrainBegin ( Model & model)
pure virtual

Implemented in NeuralNet::CSVLogger.

◆ onTrainEnd()

virtual void NeuralNet::Callback::onTrainEnd ( Model & model)
pure virtual

Implemented in NeuralNet::CSVLogger.


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