GEGELATI
Public Member Functions | List of all members
Log::LABasicLogger Class Reference

Basic logger that will display some useful information. More...

#include <laBasicLogger.h>

Inheritance diagram for Log::LABasicLogger:
Log::LALogger Log::Logger

Public Member Functions

 LABasicLogger (Learn::LearningAgent &la, std::ostream &out=std::cout)
 Same constructor as LaLogger. Default output is cout. More...
 
virtual void logHeader () override
 Logs the header (column names) of the tab that will be logged. More...
 
virtual void logNewGeneration (uint64_t &generationNumber) override
 Logs the generation of training. More...
 
virtual void logAfterPopulateTPG () override
 Logs the vertices nb of the tpg. More...
 
virtual void logAfterEvaluate (std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results) override
 Logs the min, avg and max score of the generation. More...
 
virtual void logAfterDecimate () override
 Does nothing in this logger. More...
 
virtual void logAfterValidate (std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results) override
 Logs the min, avg and max score of the generation. More...
 
virtual void logEndOfTraining () override
 Logs the eval, valid (if doValidation is true) and total running time. More...
 
- Public Member Functions inherited from Log::LALogger
 LALogger (Learn::LearningAgent &la, std::ostream &out=std::cout)
 Constructor defining a given output and setting start and checkpoint as now. Default output is cout. More...
 
void chronoFromNow ()
 Updates checkpoint to now.
 
virtual void logHeader ()=0
 Logs the header (e.g. column names) of this logger. More...
 
virtual void logNewGeneration (uint64_t &generationNumber)=0
 Method called by the LearningAgent at the start of a generation. More...
 
virtual void logAfterPopulateTPG ()=0
 Method called by the Learning Agent right after PopulateTPG is done. More...
 
virtual void logAfterEvaluate (std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results)=0
 Method called by the Learning Agent right after the evaluation is done. More...
 
virtual void logAfterDecimate ()=0
 Method called by the Learning Agent right after the decimation is done. More...
 
virtual void logAfterValidate (std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results)=0
 Method called by the Learning Agent right after the validation is done. More...
 
virtual void logEndOfTraining ()=0
 Method called by the Learning Agent when the training is done. More...
 
- Public Member Functions inherited from Log::Logger
 Logger (std::ostream &out=std::cout)
 Constructor initializing a specific output. Default is cout. More...
 
virtual ~Logger ()=default
 Virtual default destructor for polyphormism support.
 
Logger operator<< (std::ostream &(*manip)(std::ostream &))
 << operator to manipulate stream and enter stream-specific elements (like std::endl). More...
 
template<typename T >
Logger operator<< (const T &val)
 << operator allowing to log elements that ostream actually accepts (char, int...). More...
 

Additional Inherited Members

- Public Attributes inherited from Log::LALogger
bool doValidation = false
 
- Protected Member Functions inherited from Log::LALogger
double getDurationFrom (const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > &begin) const
 Computes the duration from a given time to now. More...
 
std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > getTime () const
 Gets the current time value, for example to set checkpoint. More...
 
- Protected Attributes inherited from Log::LALogger
std::shared_ptr< std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > > const start
 
std::shared_ptr< std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > > checkpoint
 
double mutationTime = 0
 
double evalTime = 0
 
double validTime = 0
 
Learn::LearningAgentlearningAgent
 LearningAgent logged by the LALogger.
 

Detailed Description

Basic logger that will display some useful information.

The information logged by this LALogger are generation number, nb of vertices, min, mean, avg score of this generation and to finish some timing. Everything is logged like a tab with regularly spaced columns.

Constructor & Destructor Documentation

◆ LABasicLogger()

Log::LABasicLogger::LABasicLogger ( Learn::LearningAgent la,
std::ostream &  out = std::cout 
)
inlineexplicit

Same constructor as LaLogger. Default output is cout.

Parameters
[in]laLearningAgent whose information will be logged by the LABasicLogger.
[in]outThe output stream the logger will send elements to.

Member Function Documentation

◆ logAfterDecimate()

virtual void Log::LABasicLogger::logAfterDecimate ( )
inlineoverridevirtual

Does nothing in this logger.

Inherited via LaLogger.

Implements Log::LALogger.

◆ logAfterEvaluate()

void Log::LABasicLogger::logAfterEvaluate ( std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &  results)
overridevirtual

Logs the min, avg and max score of the generation.

Inherited via LaLogger.

If doValidation is true, it only updates eval time. The method logResults will be called in order to log statistics about results (method shared with logAfterValidate).

Parameters
[in]resultsscores of the evaluation.

Implements Log::LALogger.

◆ logAfterPopulateTPG()

void Log::LABasicLogger::logAfterPopulateTPG ( )
overridevirtual

Logs the vertices nb of the tpg.

Inherited via LALogger.

Implements Log::LALogger.

◆ logAfterValidate()

void Log::LABasicLogger::logAfterValidate ( std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &  results)
overridevirtual

Logs the min, avg and max score of the generation.

Inherited via LaLogger.

If doValidation is true, no eval results are logged so that the logger can only show validation results.

Parameters
[in]resultsscores of the validation.

Implements Log::LALogger.

◆ logEndOfTraining()

void Log::LABasicLogger::logEndOfTraining ( )
overridevirtual

Logs the eval, valid (if doValidation is true) and total running time.

Inherited via LaLogger

Implements Log::LALogger.

◆ logHeader()

void Log::LABasicLogger::logHeader ( )
overridevirtual

Logs the header (column names) of the tab that will be logged.

Inherited via LaLogger

Implements Log::LALogger.

◆ logNewGeneration()

void Log::LABasicLogger::logNewGeneration ( uint64_t &  generationNumber)
overridevirtual

Logs the generation of training.

Inherited via LALogger.

Parameters
[in]generationNumberThe number of the current generation.

Implements Log::LALogger.


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