diffusion_models.utils.tensorboard

Module Contents

class TensorboardManager(log_name=None, log_directory=None)[source]

A tensorboard manager for simplified tensorboard logging.

Parameters:
  • log_name (Optional[str]) – The name of the tensorboard log run.

  • log_directory (Optional[Union[str, Path]]) – An explicit directory to write logs to. When provided, it takes precedence over log_name.

summary_writer[source]

The tensorboard summary writer.

log_metrics(metrics, global_step)[source]

Log metrics to tensorboard.

Parameters:
  • metrics (Dict[str, float]) – A dictionary mapping metric names to values.

  • global_step (int) – The step at which the metrics are recorded.

log_images(tag, images, timestep)[source]

Log images to tensorboard.

Parameters:
  • tag (str) – The name to give the images in tensorboard.

  • images (Tensor) – A tensor representing the images to log.

  • timestep (int) – The timestep at which the images are produced.

log_text(tag, text, global_step=0)[source]

Log text to tensorboard.

Parameters:
  • tag (str) – The name to give the text in tensorboard.

  • text (str) – The text to log (rendered as markdown by tensorboard).

  • global_step (int) – The step at which the text is recorded.

log_weights(model, global_step)[source]

Log a histogram of every model parameter to tensorboard.

Parameters:
  • model (Module) – The model whose parameters are logged.

  • global_step (int) – The step at which the weights are recorded.