TensorBoard SummaryWriter

Utilities for logging data to TensorBoard.



SummaryWriter

skrl provides a simple SummaryWriter implementation to log data to TensorBoard without relying on third-party libraries.


API

class skrl.utils.tensorboard.SummaryWriter(log_dir: str, *, queue_size: int = 10, flush_seconds: int = 120)[source]

Bases: object

TensorBoard summary writer.

Parameters:
  • log_dir – Directory to save the event file.

  • queue_size – Maximum number of events to keep in the queue before forcing a flush to persistent storage.

  • flush_seconds – Number of seconds between flushing pending events to persistent storage.

Methods:

add_scalar(*, tag, value, timestep)

Add a scalar value to the summary.

close()

Close the summary writer.

flush()

Flush pending events to persistent storage.

add_scalar(*, tag: str, value: float, timestep: int) None[source]

Add a scalar value to the summary.

Parameters:
  • tag – Name of the scalar record.

  • value – Value of the scalar.

  • timestep – Global step value to record.

close() None[source]

Close the summary writer.

flush() None[source]

Flush pending events to persistent storage.