objax.jaxboard package

Reducer(value)

Reduces tensor batch into a single tensor.

Summary

Writes entries to Summary protocol buffer.

SummaryWriter(logdir[, queue_size, …])

Writes entries to event files in the logdir to be consumed by Tensorboard.

class objax.jaxboard.Summary[source]

Writes entries to Summary protocol buffer.

image(tag, image)[source]

Adds image to the summary. Float image in [-1, 1] in CHW format expected.

Parameters
  • tag (str) –

  • image (numpy.ndarray) –

scalar(tag, value, reduce=<function Reducer.<lambda>>)[source]

Adds scalar to the summary.

Parameters
  • tag (str) –

  • value (float) –

  • reduce (Union[Callable, objax.jaxboard.Reducer]) –

text(tag, text)[source]

Adds text to the summary.

Parameters
  • tag (str) –

  • text (str) –

__call__()[source]

Call self as a function.

class objax.jaxboard.SummaryWriter(logdir, queue_size=5, write_interval=5)[source]

Writes entries to event files in the logdir to be consumed by Tensorboard.

__init__(logdir, queue_size=5, write_interval=5)[source]

Creates SummaryWriter instance.

Parameters
  • logdir (str) – directory where event file will be written.

  • queue_size (int) – size of the queue for pending events and summaries before one of the ‘add’ calls forces a flush to disk.

  • write_interval (int) – how often, in seconds, to write the pending events and summaries to disk.

write(summary, step)[source]

Adds on event to the event file.

Parameters
close()[source]

Flushes the event file to disk and close the file.