tff.learning.programs.extract_and_rewrap_metrics
Stay organized with collections
Save and categorize content based on your preferences.
Extracts a sub-structure and re-wraps it with a new prefix.
tff.learning.programs.extract_and_rewrap_metrics(
metrics_structure: Mapping[str, Any], *, path: Sequence[str]
) -> Mapping[str, Any]
This is used to normalize outputs from the training and evaluation
computations. For example, we are interested in the following substructure
from the evaluation and training tasks:
client_work/eval/current_round_metrics/...
client_work/eval/total_rounds_metrics/...
client_work/train/...
And we like to "re-home" these structures under:
model_metrics/...
while leaving all the other metrics alone. This can be thought of as a
"subtree promotion" method.
This is used for grouping metrics so that they appear aligned in
http://tensorboard/ in a uniform way. TensorBoard uses the name up to the
first /
as a tab separator in the UI.
Args |
metrics_structure
|
The nested structure of tensor-like metric values.
|
path
|
A sequence of strings that will be used to traverse the keys of
metrics_structure and identify the substructure of interest.
|
Returns |
A structure of metrics of metrics_substructure .
|
Raises |
ValueError
|
If path is empty.
|
KeyError
|
If any key in path sequence does not exist in the
metrics_structure .
|
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.
Last updated 2024-09-20 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 2024-09-20 UTC."],[],[]]