CsvLoggingCallback
- class hybrid_learning.concepts.train_eval.callbacks.CsvLoggingCallback(log_dir='.', overwrite='warn')[source]
Bases:
CallbackExtract the values stored in matplotlib figures and store them as CSV. Only figures with one axis and one line in the plot are supported. Figure data is saved into a CSV file under
log_dirwith the name given byto_descriptor()with one column for x-data, one for y-data.Note
For the file path format see
file_path_for()andfile_paths_in().Public Data Attributes:
The default KPI name for CSV files collecting non-image metric data.
A default description to use if no other folder identifier can be determined.
Public Methods:
file_path_for(kpi_name[, run_type, ...])Given logging specs provide the file path these should be located at.
after_epoch_train(kpi_train[, epoch, ...])Save figures in the final batch results.
after_epoch_eval(kpi_val[, epoch, ...])Save figures in the eval epoch results.
from_csv([file_path, kpi_name, run_type, ...])Read a previously saved
pandas.DataFrame.Inherited from : py: class:Callback
keys()Collect a list of all supported callback events.
Inherited from : py: class:Mapping
get(k[,d])keys()Collect a list of all supported callback events.
items()values()Special Methods:
__init__([log_dir, overwrite])Init.
Inherited from : py: class:Callback
__getitem__(event)Get the method for the specified event or a pass lambda.
__len__()Number of mapped events.
__iter__()Iterate over mapped events.
Inherited from : py: class:Mapping
__getitem__(event)Get the method for the specified event or a pass lambda.
__contains__(key)__eq__(other)Return self==value.
Inherited from : py: class:Sized
__len__()Number of mapped events.
Inherited from : py: class:Iterable
__iter__()Iterate over mapped events.
Inherited from : py: class:Container
__contains__(key)
- after_epoch_eval(kpi_val, epoch=None, log_prefix=None, run=None, run_type='eval', **_)[source]
Save figures in the eval epoch results.
- after_epoch_train(kpi_train, epoch=None, log_prefix=None, run=None, run_type='train', **_)[source]
Save figures in the final batch results.
- file_path_for(kpi_name, run_type=None, log_prefix=None, run=None, epoch=None, batch=None, default_desc=None)[source]
Given logging specs provide the file path these should be located at.
- Parameters
- Return type
- classmethod file_paths_in(log_dir, use_abs_paths=True)[source]
Given a
log_dirreturn information on saved metrics.- Parameters
- Returns
a DataFrame containing in each row meta information and the relative file path to a saved metric.
- Return type
- from_csv(file_path=None, kpi_name='other', run_type=None, log_prefix=None, run=None, epoch=None, batch=None)[source]
Read a previously saved
pandas.DataFrame. Either givefile_pathor a combination of the other infos.
- DEFAULT_DESC: str = '_'
A default description to use if no other folder identifier can be determined.
- __parameters__ = ()