Callbacks and Loggers
API reference: pe.callback package and pe.logger package.
pe.callback.callback.Callback
can be configured to be called after each Private Evolution iteration with the synthetic data as the input. It is useful for computing metrics, saving the synthetic samples, monitoring the progress, etc. Each pe.callback.callback.Callback
can return a list of results (float numbers, images, matplotlib plots, etc.) in the form of pe.metric_item.MetricItem
(see pe.metric_item
). All pe.metric_item.MetricItem
from all pe.callback.callback.Callback
will be passed through each of the pe.logger.logger.Logger
modules, which will then log the results in the desired way.
Available Callbacks
Currently, the following callbacks are implemented:
For any data modality
pe.callback.common.compute_fid.ComputeFID
: Computes the FID between the synthetic samples and the private samples.pe.callback.common.save_checkpoints.SaveCheckpoints
: Saves the checkpoint of current synthetic samples to files.
Images
pe.callback.image.sample_images.SampleImages
: Samples some images from each class.pe.callback.image.save_all_images.SaveAllImages
: Saves all synthetic images to files.
Text
Coming soon!
Available Loggers
Currently, the following loggers are implemented:
pe.logger.csv_print.CSVPrint
: Saves the float results to a CSV file.pe.logger.log_print.LogPrint
: Prints the float results to the console and/or files using the logging module.pe.logger.image_file.ImageFile
: Saves the images to files.pe.logger.matplotlib_pdf.MatplotlibPDF
: Saves the matplotlib plots to PDF files.