This function computes a sum such that it should not be possible for the
server to learn any clients individual value. The specific algorithm and
mechanism used to compute the secure sum may vary depending on the target
runtime environment the computation is compiled for or executed on. See
https://research.google/pubs/pub47246/ for more information.
Not all executors support
tff.backends.mapreduce.federated_secure_modular_sum(); consult the
documentation for the specific executor or executor stack you plan on using
for the specific of how it's handled by that executor.
The modulus argument is the modulus under which the client values are added.
The result of this function will be equivalent to SUM(value) % modulus.
Lower values may allow for improved communication efficiency.
An integer or nested structure of integers placed at tff.CLIENTS.
Values outside of the range [0, modulus-1] will be considered equivalent
to mod(value, modulus), i.e. they will be projected into the range [0,
modulus-1] as part of the modular summation.
modulus
A Python integer or nested structure of integers matching the
structure of value. If integer modulus is used with a nested value,
the same integer is used for each tensor in value.
Returns
A representation of the modular sum of the member constituents of value
placed on the tff.SERVER. The resulting modular sum will be on the range
[0, modulus-1].
Raises
TypeError
If the argument is not a federated TFF value placed at
tff.CLIENTS.
[null,null,["Last updated 2024-09-20 UTC."],[],[],null,["# tff.backends.mapreduce.federated_secure_modular_sum\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\nComputes a modular sum at [`tff.SERVER`](../../../tff#SERVER) of a `value` from [`tff.CLIENTS`](../../../tff#CLIENTS). \n\n tff.backends.mapreduce.federated_secure_modular_sum(\n value, modulus\n )\n\nThis function computes a sum such that it should not be possible for the\nserver to learn any clients individual value. The specific algorithm and\nmechanism used to compute the secure sum may vary depending on the target\nruntime environment the computation is compiled for or executed on. See\n\u003chttps://research.google/pubs/pub47246/\u003e for more information.\n\nNot all executors support\n[`tff.backends.mapreduce.federated_secure_modular_sum()`](../../../tff/backends/mapreduce/federated_secure_modular_sum); consult the\ndocumentation for the specific executor or executor stack you plan on using\nfor the specific of how it's handled by that executor.\n\nThe `modulus` argument is the modulus under which the client values are added.\nThe result of this function will be equivalent to `SUM(value) % modulus`.\n*Lower values may allow for improved communication efficiency.*\n\n#### Example:\n\n value = tff.federated_value(5, tff.CLIENTS)\n result = tff.backends.mapreduce.federated_secure_modular_sum(value, 3)\n # `result == (5 * num_clients % 3)@SERVER`\n\n value = tff.federated_value((3, 9), tff.CLIENTS)\n result = tff.backends.mapreduce.federated_secure_modular_sum(\n value, (100, 200))\n # `result == (3 * num_clients % 100, 9 * num_clients % 100)@SERVER`\n\n| **Note:** To sum non-integer values or to sum integers with fewer constraints and weaker privacy properties, consider using `federated_sum`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `value` | An integer or nested structure of integers placed at [`tff.CLIENTS`](../../../tff#CLIENTS). Values outside of the range \\[0, modulus-1\\] will be considered equivalent to mod(value, modulus), i.e. they will be projected into the range \\[0, modulus-1\\] as part of the modular summation. |\n| `modulus` | A Python integer or nested structure of integers matching the structure of `value`. If integer `modulus` is used with a nested `value`, the same integer is used for each tensor in `value`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A representation of the modular sum of the member constituents of `value` placed on the [`tff.SERVER`](../../../tff#SERVER). The resulting modular sum will be on the range \\[0, modulus-1\\]. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|-----------------------------------------------------------------------------------------------|\n| `TypeError` | If the argument is not a federated TFF value placed at [`tff.CLIENTS`](../../../tff#CLIENTS). |\n\n\u003cbr /\u003e"]]