uv.tensorflow package

Submodules

uv.tensorflow.reporter module

Tensorflow / Tensorboard reporter that conforms to UV’s reporter interface.

In its current form, the TensorboardReporter is able to report scalars.

TODO Add support for logging images directly using: https://github.com/tensorflow/tensorflow/blob/r2.1/tensorflow/python/keras/callbacks.py#L1400

TODO investigate docs on how to serialize entries: https://github.com/tensorflow/tensorboard/blob/master/docs/r1/summaries.md

class uv.tensorflow.reporter.TensorboardReporter(log_dir: str, max_queue: Optional[int] = 100, flush_millis: Optional[int] = None, filename_suffix: Optional[str] = None)[source]

Bases: uv.reporter.base.AbstractReporter

Reporter implementation that accepts scalar metrics and reports them to an underlying Tensorboard file writer in the supplied directory.

TensorboardReporter’s log_dir argument can be either a local path or a GCloud path, prefixed with gs://.

Arguments to the TensorboardReporter constructor match the arguments of https://www.tensorflow.org/api_docs/python/tf/summary/create_file_writer.

Parameters
  • log_dir – a string specifying the directory in which to write an event file.

  • max_queue – the largest number of summaries to keep in a queue; will flush once the queue gets bigger than this. Defaults to 100.

  • flush_millis – the largest interval between flushes. Defaults to 120,000.

  • filename_suffix – optional suffix for the event file name. Defaults to .v2.

  • name – a name for the op that creates the writer.

close()None[source]

Release any resources held open by this reporter instance.

report(step: int, k: str, v: Any)None[source]

Accepts a step (an ordered int referencing some timestep), a metric key and a value, and persists the metric into some underlying store.

report_all(step: int, m: Dict[str, Any])None[source]

Accepts a step (an ordered int referencing some timestep) and a dictionary of metric key => metric value, and persists the metric into some underlying store.

Extending classes are expected to perform some side effect that’s either visually useful, as in a live-plot, or recoverable via some matching extension of AbstractReader.

Module contents