orbit.utils.SummaryManager

View source on GitHub

A utility class for managing summary writing.

Inherits From: SummaryManagerInterface

orbit.utils.SummaryManager(
 summary_dir, summary_fn, global_step=None
)

Args

summary_dir The directory in which to write summaries. If None, all summary writing operations provided by this class are no-ops.
summary_fn A callable defined accepting name, value, and step parameters, making calls to tf.summary functions to write summaries.
global_step A tf.Variable containing the global step value.

Methods

flush

View source

flush()

Flushes the underlying summary writers.

summary_writer

View source

summary_writer(
 relative_path=''
)

Returns the underlying summary writer for a specific subdirectory.

Args
relative_path The current path in which to write summaries, relative to the summary directory. By default it is empty, which corresponds to the root directory.

write_summaries

View source

write_summaries(
 summary_dict
)

Writes summaries for the given dictionary of values.

This recursively creates subdirectories for any nested dictionaries provided in summary_dict, yielding a hierarchy of directories which will then be reflected in the TensorBoard UI as different colored curves.

For example, users may evaluate on multiple datasets and return summary_dict as a nested dictionary:

{
 "dataset1": {
 "loss": loss1,
 "accuracy": accuracy1
 },
 "dataset2": {
 "loss": loss2,
 "accuracy": accuracy2
 },
}

This will create two subdirectories, "dataset1" and "dataset2", inside the summary root directory. Each directory will contain event files including both "loss" and "accuracy" summaries.

Args
summary_dict A dictionary of values. If any value in summary_dict is itself a dictionary, then the function will create a subdirectory with name given by the corresponding key. This is performed recursively. Leaf values are then summarized using the summary writer instance specific to the parent relative path.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2025年04月18日 UTC.