pe.logger.csv_print module
- class pe.logger.csv_print.CSVPrint(output_folder, path_separator='-', float_format='.8f', flush_iteration_freq=1)[source]
Bases:
Logger
The logger that prints the metrics to CSV files.
- __init__(output_folder, path_separator='-', float_format='.8f', flush_iteration_freq=1)[source]
Constructor.
- Parameters:
output_folder (str) – The output folder that will be used to save the CSV files
path_separator (str, optional) – The string that will be used to replace ‘’ and ‘/’ in log names, defaults to “-”
float_format (str, optional) – The format of the floating point numbers, defaults to “.8f”
flush_iteration_freq (int, optional) – The frequency to flush the logs, defaults to 1
- _get_log_path(iteration, item)[source]
Get the log path.
- Parameters:
iteration (int) – The PE iteration number
item (
pe.metric_item.MetricItem
) – The metric item
- Returns:
The log path
- Return type:
str
- _log_float(log_path, iteration, item)[source]
Log a float metric item.
- Parameters:
log_path (str) – The path of the log file
iteration (int) – The PE iteration number
item (
pe.metric_item.FloatMetricItem
orpe.metric_item.FloatListMetricItem
) – The float metric item
- log(iteration, metric_items)[source]
Log the metrics.
- Parameters:
iteration (int) – The PE iteration number
metric_items (list[
pe.metric_item.MetricItem
]) – The metrics to log