pe.logger package

Submodules

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

_clear_logs()[source]

Clear the logs.

_flush()[source]

Flush the logs.

_get_log_path(iteration, item)[source]

Get the log path.

Parameters:
Returns:

The log path

Return type:

str

_log_float(log_path, iteration, item)[source]

Log a float metric item.

Parameters:
clean_up()[source]

Clean up the logger.

log(iteration, metric_items)[source]

Log the metrics.

Parameters:

pe.logger.image_file module

class pe.logger.image_file.ImageFile(output_folder, path_separator='-', iteration_format='09d')[source]

Bases: Logger

The logger that saves images to files.

__init__(output_folder, path_separator='-', iteration_format='09d')[source]

Constructor.

Parameters:
  • output_folder (str) – The output folder that will be used to save the images

  • path_separator (str, optional) – The string that will be used to replace ‘’ and ‘/’ in log names, defaults to “-”

  • iteration_format (str, optional) – The format of the iteration number, defaults to “09d”

_get_image_path(iteration, item)[source]

Get the image save path.

Parameters:
Returns:

The image save path

Return type:

str

_log_image(image_path, item)[source]

Log a single image.

Parameters:
_log_image_list(image_path, item)[source]

Log a list of images.

Parameters:
log(iteration, metric_items)[source]

Log the images.

Parameters:

pe.logger.log_print module

class pe.logger.log_print.LogPrint(log_iteration_freq=1)[source]

Bases: Logger

The logger that prints the metrics to the console/file using pe.logging.execution_logger.

__init__(log_iteration_freq=1)[source]

Constructor.

Parameters:

log_iteration_freq (int, optional) – The frequency to log the metrics, defaults to 1

log(iteration, metric_items)[source]

Log the metrics to the console/file.

Parameters:

pe.logger.logger module

class pe.logger.logger.Logger[source]

Bases: ABC

The abstract class for logging the metrics

clean_up()[source]

Clean up the logger.

abstract log(iteration, metric_items)[source]

Log the metrics.

Parameters:

pe.logger.matplotlib_pdf module

class pe.logger.matplotlib_pdf.MatplotlibPDF(output_folder, path_separator='-', iteration_format='09d')[source]

Bases: Logger

The logger that saves Matplotlib figures to PDF files.

__init__(output_folder, path_separator='-', iteration_format='09d')[source]

Constructor.

Parameters:
  • output_folder (str) – The output folder that will be used to save the PDF files

  • path_separator (str, optional) – The string that will be used to replace ‘’ and ‘/’ in log names, defaults to “-”

  • iteration_format (str, optional) – The format of the iteration number, defaults to “09d”

_get_pdf_path(iteration, item)[source]

Get the PDF save path.

Parameters:
Returns:

The PDF save path

Return type:

str

log(iteration, metric_items)[source]

Log the Matplotlib figures to PDF files.

Parameters: