# tff.analytics.heavy_hitters.iblt.ClippingIbltFactory

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) 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) |

Factory for clipping client data before aggregation.

Inherits From: [`UnweightedAggregationFactory`](https://www.tensorflow.org/federated/api_docs/python/tff/aggregators/UnweightedAggregationFactory)

    tff.analytics.heavy_hitters.iblt.ClippingIbltFactory(
        inner_iblt_agg: https://www.tensorflow.org/federated/api_docs/python/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
    )

<br />

<br />

<br />

| ## 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`](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. |
| `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\]. |

<br />

## Methods

### `create`

[View source](https://github.com/tensorflow/federated/blob/v0.87.0
Version 2.0, January 2004
Licensed under the Apache License, Version 2.0 (the)

    create(
        value_type: factory.ValueType
    ) -> https://www.tensorflow.org/federated/api_docs/python/tff/templates/AggregationProcess

Creates a `tff.aggregators.AggregationProcess` without weights.

The provided `value_type` is a non-federated [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type), that is, not a
[`tff.FederatedType`](https://www.tensorflow.org/federated/api_docs/python/tff/types/FederatedType).

The returned `tff.aggregators.AggregationProcess` will be created for
aggregation of values matching `value_type` placed at [`tff.CLIENTS`](https://www.tensorflow.org/federated/api_docs/python/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.

<br />

<br />

<br />

| Args ||
|---|---|
| `value_type` | A non-federated [`tff.Type`](https://www.tensorflow.org/federated/api_docs/python/tff/types/Type). |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A [`tff.templates.AggregationProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/AggregationProcess). ||

<br />