tff.learning.add_debug_measurements
Stay organized with collections
Save and categorize content based on your preferences.
Adds measurements suitable for debugging learning processes.
tff.learning.add_debug_measurements(
aggregation_factory: _AggregationFactory
) -> _AggregationFactory
This will wrap a tff.aggregator.AggregationFactory
as a new factory that
will produce additional measurements useful for debugging learning processes.
The underlying aggregation of client values will remain unchanged.
These measurements generally concern the norm of the client updates, and the
norm of the aggregated server update. The implicit weighting will be
determined by aggregation_factory
: If this is weighted, then the debugging
measurements will use this weighting when computing averages. If it is
unweighted, the debugging measurements will use uniform weighting.
The client measurements are:
- The average Euclidean norm of client updates.
- The standard deviation of these norms.
The standard deviation we report is the square root of the unbiased
variance. The server measurements are:
- The maximum entry of the aggregate client update.
- The Euclidean norm of the aggregate client update.
- The minimum entry of the aggregate client update.
In the above, an "entry" means any coordinate across all tensors in the
structure. For example, suppose that we have client structures before
aggregation:
- Client A:
[[-1, -3, -5], [2]]
- Client B:
[[-1, -3, 1], [0]]
If we use unweighted averaging, then the aggregate client update will be the
structure [[-1, -3, -2], [1]]
. The maximum entry is 1
, the minimum entry
is -3
, and the euclidean norm is sqrt(15)
.
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."],[],[],null,["# tff.learning.add_debug_measurements\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |\n\nAdds measurements suitable for debugging learning processes. \n\n tff.learning.add_debug_measurements(\n aggregation_factory: _AggregationFactory\n ) -\u003e _AggregationFactory\n\nThis will wrap a `tff.aggregator.AggregationFactory` as a new factory that\nwill produce additional measurements useful for debugging learning processes.\nThe underlying aggregation of client values will remain unchanged.\n\nThese measurements generally concern the norm of the client updates, and the\nnorm of the aggregated server update. The implicit weighting will be\ndetermined by `aggregation_factory`: If this is weighted, then the debugging\nmeasurements will use this weighting when computing averages. If it is\nunweighted, the debugging measurements will use uniform weighting.\n\nThe client measurements are:\n\n- The average Euclidean norm of client updates.\n- The standard deviation of these norms.\n\nThe standard deviation we report is the square root of the **unbiased**\nvariance. The server measurements are:\n\n- The maximum entry of the aggregate client update.\n- The Euclidean norm of the aggregate client update.\n- The minimum entry of the aggregate client update.\n\nIn the above, an \"entry\" means any coordinate across all tensors in the\nstructure. For example, suppose that we have client structures before\naggregation:\n\n- Client A: `[[-1, -3, -5], [2]]`\n- Client B: `[[-1, -3, 1], [0]]`\n\nIf we use unweighted averaging, then the aggregate client update will be the\nstructure `[[-1, -3, -2], [1]]`. The maximum entry is `1`, the minimum entry\nis `-3`, and the euclidean norm is `sqrt(15)`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------|--------------------------------------------------------------------------------------------------------------------|\n| `aggregation_factory` | A [`tff.aggregators.AggregationFactory`](../../tff/aggregators/AggregationFactory). Can be weighted or unweighted. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A [`tff.aggregators.AggregationFactory`](../../tff/aggregators/AggregationFactory). ||\n\n\u003cbr /\u003e"]]