tff.analytics.heavy_hitters.iblt.ClippingIbltFactory
Stay organized with collections
Save and categorize content based on your preferences.
Factory for clipping client data before aggregation.
Inherits From: UnweightedAggregationFactory
tff.analytics.heavy_hitters.iblt.ClippingIbltFactory(
inner_iblt_agg: tff.analytics.IbltFactory
,
max_words_per_user: Optional[int] = None,
multi_contribution: bool = True,
batch_size: int = 1,
string_max_bytes: int = 10,
unique_counts: bool = False
)
Args |
inner_iblt_agg
|
An instance of IbltFactory.
|
max_words_per_user
|
The maximum total count each client is allowed to
contribute across all words. If not None , must be a positive integer.
Defaults to None , which means all the clients contribute all their
words. Note that this does not cap the count of each individual word
each client can contribute. Set multi_contirbution=False to restrict
the per-client count for each word.
|
multi_contribution
|
Whether each client is allowed to contribute multiple
instances of each string, or only a count of one for each unique word.
Defaults to True meaning clients contribute the full count for each
contributed string. Note that this doesn't limit the total number of
strings each client can contribute. Set max_words_per_user to limit
the total number of strings per client.
|
batch_size
|
The number of elements in each batch of the dataset. Batching
is an optimization for pulling multiple inputs at a time from the input
tf.data.Dataset , amortizing the overhead cost of each read to the
batch_size . Consider batching if you observe poor client execution
performance or reading inputs is particularly expsensive. Defaults to
1 , means the input dataset is processed by tf.data.Dataset.batch(1) .
Must be positive.
|
string_max_bytes
|
The maximum length in bytes of a string in the IBLT.
Strings longer than string_max_bytes will be truncated. Defaults to
10 . Must be positive.
|
unique_counts
|
If True, the value for every element is the array [count,
1].
|
Methods
create
View source
create(
value_type: factory.ValueType
) -> tff.templates.AggregationProcess
Creates a tff.aggregators.AggregationProcess
without weights.
The provided value_type
is a non-federated tff.Type
, that is, not a
tff.FederatedType
.
The returned tff.aggregators.AggregationProcess
will be created for
aggregation of values matching value_type
placed at tff.CLIENTS
.
That is, its next
method will expect type
<S@SERVER, {value_type}@CLIENTS>
, where S
is the unplaced return type of
its initialize
method.
Args |
value_type
|
A non-federated tff.Type .
|
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.analytics.heavy_hitters.iblt.ClippingIbltFactory\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\nFactory for clipping client data before aggregation.\n\nInherits From: [`UnweightedAggregationFactory`](../../../../tff/aggregators/UnweightedAggregationFactory) \n\n tff.analytics.heavy_hitters.iblt.ClippingIbltFactory(\n inner_iblt_agg: ../../../../tff/analytics/IbltFactory,\n max_words_per_user: Optional[int] = None,\n multi_contribution: bool = True,\n batch_size: int = 1,\n string_max_bytes: int = 10,\n unique_counts: bool = False\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inner_iblt_agg` | An instance of IbltFactory. |\n| `max_words_per_user` | The maximum total count each client is allowed to contribute across all words. If not `None`, must be a positive integer. Defaults to `None`, which means all the clients contribute all their words. Note that this does not cap the count of each individual word each client can contribute. Set `multi_contirbution=False` to restrict the per-client count for each word. |\n| `multi_contribution` | Whether each client is allowed to contribute multiple instances of each string, or only a count of one for each unique word. Defaults to `True` meaning clients contribute the full count for each contributed string. Note that this doesn't limit the total number of strings each client can contribute. Set `max_words_per_user` to limit the total number of strings per client. |\n| `batch_size` | The number of elements in each batch of the dataset. Batching is an optimization for pulling multiple inputs at a time from the input [`tf.data.Dataset`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset), amortizing the overhead cost of each read to the `batch_size`. Consider batching if you observe poor client execution performance or reading inputs is particularly expsensive. Defaults to `1`, means the input dataset is processed by [`tf.data.Dataset.batch(1)`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#batch). Must be positive. |\n| `string_max_bytes` | The maximum length in bytes of a string in the IBLT. Strings longer than `string_max_bytes` will be truncated. Defaults to `10`. Must be positive. |\n| `unique_counts` | If True, the value for every element is the array \\[count, 1\\]. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `create`\n\n[View source](https://github.com/tensorflow/federated/blob/v0.87.0\nVersion 2.0, January 2004\nLicensed under the Apache License, Version 2.0 (the) \n\n create(\n value_type: factory.ValueType\n ) -\u003e ../../../../tff/templates/AggregationProcess\n\nCreates a `tff.aggregators.AggregationProcess` without weights.\n\nThe provided `value_type` is a non-federated [`tff.Type`](../../../../tff/types/Type), that is, not a\n[`tff.FederatedType`](../../../../tff/types/FederatedType).\n\nThe returned `tff.aggregators.AggregationProcess` will be created for\naggregation of values matching `value_type` placed at [`tff.CLIENTS`](../../../../tff#CLIENTS).\nThat is, its `next` method will expect type\n`\u003cS@SERVER, {value_type}@CLIENTS\u003e`, where `S` is the unplaced return type of\nits `initialize` method.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|--------------|-----------------------------------------------------------|\n| `value_type` | A non-federated [`tff.Type`](../../../../tff/types/Type). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A [`tff.templates.AggregationProcess`](../../../../tff/templates/AggregationProcess). ||\n\n\u003cbr /\u003e"]]