orbit.utils.SummaryManager
Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-18 UTC."],[],[],null,["# orbit.utils.SummaryManager\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/models/blob/v2.19.1/orbit/utils/summary_manager.py#L24-L112) |\n\nA utility class for managing summary writing.\n\nInherits From: [`SummaryManagerInterface`](../../orbit/utils/SummaryManagerInterface) \n\n orbit.utils.SummaryManager(\n summary_dir, summary_fn, global_step=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `summary_dir` | The directory in which to write summaries. If `None`, all summary writing operations provided by this class are no-ops. |\n| `summary_fn` | A callable defined accepting `name`, `value`, and `step` parameters, making calls to [`tf.summary`](https://www.tensorflow.org/api_docs/python/tf/summary) functions to write summaries. |\n| `global_step` | A [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable) containing the global step value. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `flush`\n\n[View source](https://github.com/tensorflow/models/blob/v2.19.1/orbit/utils/summary_manager.py#L64-L67) \n\n flush()\n\nFlushes the underlying summary writers.\n\n### `summary_writer`\n\n[View source](https://github.com/tensorflow/models/blob/v2.19.1/orbit/utils/summary_manager.py#L47-L62) \n\n summary_writer(\n relative_path=''\n )\n\nReturns the underlying summary writer for a specific subdirectory.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n\n\u003cbr /\u003e\n\n### `write_summaries`\n\n[View source](https://github.com/tensorflow/models/blob/v2.19.1/orbit/utils/summary_manager.py#L69-L103) \n\n write_summaries(\n summary_dict\n )\n\nWrites summaries for the given dictionary of values.\n\nThis recursively creates subdirectories for any nested dictionaries\nprovided in `summary_dict`, yielding a hierarchy of directories which will\nthen be reflected in the TensorBoard UI as different colored curves.\n\nFor example, users may evaluate on multiple datasets and return\n`summary_dict` as a nested dictionary: \n\n {\n \"dataset1\": {\n \"loss\": loss1,\n \"accuracy\": accuracy1\n },\n \"dataset2\": {\n \"loss\": loss2,\n \"accuracy\": accuracy2\n },\n }\n\nThis will create two subdirectories, \"dataset1\" and \"dataset2\", inside the\nsummary root directory. Each directory will contain event files including\nboth \"loss\" and \"accuracy\" summaries.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n\n\u003cbr /\u003e"]]