NeuralNet 1.0
Loading...
Searching...
No Matches
NeuralNet::CSVLogger Class Reference
Inheritance diagram for NeuralNet::CSVLogger:
NeuralNet::Callback

Public Member Functions

 CSVLogger (const std::string &filepath, const std::string &separator=",")
 CSVLogger is a Callback that streams epoch results to a csv file.
 
void onEpochBegin (Model &model) override
 
void onEpochEnd (Model &model) override
 This method will be called at the end of each epoch.
 
void onTrainBegin (Model &model) override
 This method will be called at the beginning of the training.
 
void onTrainEnd (Model &model) override
 This method will be called at the end of the training.
 
void onBatchBegin (Model &model) override
 
void onBatchEnd (Model &model) override
 

Additional Inherited Members

- Static Public Member Functions inherited from NeuralNet::Callback
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 inherited from NeuralNet::Callback
static void checkMetric (const std::string &metric, const std::vector< std::string > &metrics)
 
static std::unordered_map< std::string, Logs > getLogs (Model &model)
 

Constructor & Destructor Documentation

◆ CSVLogger()

NeuralNet::CSVLogger::CSVLogger ( const std::string & filepath,
const std::string & separator = "," )
inline

CSVLogger is a Callback that streams epoch results to a csv file.

Parameters
filepathThe name of the csv file
separatorThe separator used in the csv file (default: ",")

Member Function Documentation

◆ onBatchBegin()

void NeuralNet::CSVLogger::onBatchBegin ( Model & model)
inlineoverridevirtual

Implements NeuralNet::Callback.

◆ onBatchEnd()

void NeuralNet::CSVLogger::onBatchEnd ( Model & model)
inlineoverridevirtual

Implements NeuralNet::Callback.

◆ onEpochBegin()

void NeuralNet::CSVLogger::onEpochBegin ( Model & model)
inlineoverridevirtual

Implements NeuralNet::Callback.

◆ onEpochEnd()

void NeuralNet::CSVLogger::onEpochEnd ( Model & model)
inlineoverridevirtual

This method will be called at the end of each epoch.

In the case of CSVLogger, it will append the logs of the current epoch to data which onTrainEnd will be written to the file.

Parameters
logsThe logs of the current epoch

Implements NeuralNet::Callback.

◆ onTrainBegin()

void NeuralNet::CSVLogger::onTrainBegin ( Model & model)
inlineoverridevirtual

This method will be called at the beginning of the training.

It will initialize the headers with the logs keys.

Parameters
logsThe logs of the current epoch

Implements NeuralNet::Callback.

◆ onTrainEnd()

void NeuralNet::CSVLogger::onTrainEnd ( Model & model)
inlineoverridevirtual

This method will be called at the end of the training.

It will write the data in the given csv file.

Parameters
logsThe logs of the current epoch

Implements NeuralNet::Callback.


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