QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.logging.AlgorithmLogger Class Reference
Inheritance diagram for qdpy.algorithms.logging.AlgorithmLogger:
qdpy.base.Saveable qdpy.algorithms.logging.TQDMAlgorithmLogger qdpy.algorithms.logging.TQDMAlgorithmLogger

Public Member Functions

pd.DataFrame evals (self)
pd.DataFrame iterations (self)
Mapping[str, Any] __get_saved_state__ (self)
None monitor (self, Union[QDAlgorithmLike, Sequence[QDAlgorithmLike]] algorithms)
None register_stat (self, *LoggerStat stat)
Public Member Functions inherited from qdpy.base.Saveable
Mapping[str, Any] __get_saved_state__ (self)
None save (self, str output_path, str output_type="pickle")

Protected Member Functions

str _gen_iteration_filename (self, Optional[int] iteration=None)
None _tell (self, QDAlgorithmLike algo, IndividualLike ind, bool added, Mapping[str, Any] xattr={})
 Publish a complete evaluation row under the table lock.

Detailed Description

Collect evaluation and iteration records through optimiser callbacks.

Evaluation records include the incumbent's raw objectives, archive
size, and duration. The objective columns are named ``max0``,
``max1``, and so on, including in minimising runs. Missing objective
values in mixed runs are represented by NaN.

Display an unavailable normalised QD score as ``N/A`` and store it
as ``nan`` in the iteration table so it can be read as a number.

Set ``save_period`` to write periodic iteration snapshots, or zero to
disable them. ``final_filename`` controls the final pickle snapshot.
``final_hdf_filename`` optionally writes evaluation and iteration
tables with the HDF5 extra.

A saved result contains the archive, metrics, and supplied config
where available. Continue a current experiment with an explicit
warm start when needed. Result logs do not capture all evaluator and
random generator state.

Definition at line 54 of file logging.py.

Member Function Documentation

◆ __get_saved_state__()

Mapping[str, Any] qdpy.algorithms.logging.AlgorithmLogger.__get_saved_state__ ( self)
Return a dictionary containing the relevant information to save.
Only include information from `self.algorithms`, and evaluations and iterations DataFrames.

Definition at line 165 of file logging.py.

◆ _gen_iteration_filename()

str qdpy.algorithms.logging.AlgorithmLogger._gen_iteration_filename ( self,
Optional[int] iteration = None )
protected
Generate the filename of an iteration log file.

Definition at line 178 of file logging.py.

◆ _tell()

None qdpy.algorithms.logging.AlgorithmLogger._tell ( self,
QDAlgorithmLike algo,
IndividualLike ind,
bool added,
Mapping[str, Any] xattr = {} )
protected

Publish a complete evaluation row under the table lock.

Parameters
algoAlgorithm that had its evaluation reported.
indEvaluated candidate.
addedReported archive update result.
xattrAdditional optimisation feedback metadata.

Compute user statistics outside the lock. A failure leaves the preceding records available. Add NaN placeholders when a later record introduces another objective or statistic column.

Definition at line 255 of file logging.py.

◆ evals()

pd.DataFrame qdpy.algorithms.logging.AlgorithmLogger.evals ( self)
The recorded evaluation statistics as a data frame.

Definition at line 153 of file logging.py.

◆ iterations()

pd.DataFrame qdpy.algorithms.logging.AlgorithmLogger.iterations ( self)
The recorded iteration statistics as a data frame.

Definition at line 159 of file logging.py.

◆ monitor()

None qdpy.algorithms.logging.AlgorithmLogger.monitor ( self,
Union[QDAlgorithmLike, Sequence[QDAlgorithmLike]] algorithms )
Attach evaluation, iteration, start, and finish callbacks to the specified optimisers.

Definition at line 307 of file logging.py.

◆ register_stat()

None qdpy.algorithms.logging.AlgorithmLogger.register_stat ( self,
*LoggerStat stat )
Register one or more LoggerStat entries on this logger.

Definition at line 319 of file logging.py.


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