tff.learning.templates.reject_non_finite_update
Stay organized with collections
Save and categorize content based on your preferences.
Rejects the update if any non-finite value is in the update.
tff.learning.templates.reject_non_finite_update(
state: Any, update: Any
) -> tuple[tf.Tensor, _MeasurementsType]
This is the default should_reject_update
function used in
build_apply_optimizer_finalizer
.
Args |
state
|
Unused optimzier state.
|
update
|
The update to be applied to the model's weights by the optimizer.
|
Returns |
A tuple of:
- should_reject (bool tensor): True if the update should be rejected,
False otherwise.
- measurements (OrderedDict): A dict with a single key
(
update_non_finite ) an an integer tensor of whether the update was
rejected.
|
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.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.learning.templates.reject_non_finite_update\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\nRejects the update if any non-finite value is in the update. \n\n tff.learning.templates.reject_non_finite_update(\n state: Any, update: Any\n ) -\u003e tuple[tf.Tensor, _MeasurementsType]\n\nThis is the default `should_reject_update` function used in\n`build_apply_optimizer_finalizer`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|-------------------------------------------------------------------|\n| `state` | Unused optimzier state. |\n| `update` | The update to be applied to the model's weights by the optimizer. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tuple of: \u003cbr /\u003e - should_reject (bool tensor): True if the update should be rejected, False otherwise. - measurements (OrderedDict): A dict with a single key (`update_non_finite`) an an integer tensor of whether the update was rejected. ||\n\n\u003cbr /\u003e"]]