# tff.analytics.heavy_hitters.iblt.CoupledHyperEdgeHasher

<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) |

Hashes a string to an hyper-edge with coupled indices.

    tff.analytics.heavy_hitters.iblt.CoupledHyperEdgeHasher(
        seed: int, table_size: int, repetitions: int, rescale_factor: float
    )

For a string, generates a set of indices such that the indices are close to
each as described in <https://arxiv.org/pdf/2001.10500.pdf>

<br />

<br />

<br />

| ## Args ||
|---|---|
| `seed` | An integer seed for hash functions. |
| `table_size` | The hash table size of the IBLT. Must be a positive integer. |
| `repetitions` | The number of repetitions in IBLT data structure. Must be at least 3. |
| `rescale_factor` | A float to rescale `table_size` to `table_size / rescale_factor + 1`. This number is denoted as `z` in https://arxiv.org/pdf/2001.10500.pdf. Must be non-negative and no greater than `table_size - 1`. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If arguments do not meet expectations. |

<br />

## Methods

### `get_hash_indices_tf`

[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)

    get_hash_indices_tf(
        data_strings
    )

Returns Tensor containing hash-position of `(input string, repetition)`.

<br />

<br />

<br />

| Args ||
|---|---|
| `data_strings` | A [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of shape `(input_length, repetitions, 3)` containing value `i` at index `(i, r, 0)`, value `r` at index `(i, r, 1)` and the hash-index of the `i-th` input string in repetition `r` at index `(i, r, 2)`. ||

<br />