tff.analytics.heavy_hitters.iblt.CoupledHyperEdgeHasher
Stay organized with collections
Save and categorize content based on your preferences.
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
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 .
|
Raises |
ValueError
|
If arguments do not meet expectations.
|
Methods
get_hash_indices_tf
View source
get_hash_indices_tf(
data_strings
)
Returns Tensor containing hash-position of (input string, repetition)
.
Returns |
A 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) .
|
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.CoupledHyperEdgeHasher\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\nHashes a string to an hyper-edge with coupled indices. \n\n tff.analytics.heavy_hitters.iblt.CoupledHyperEdgeHasher(\n seed: int, table_size: int, repetitions: int, rescale_factor: float\n )\n\nFor a string, generates a set of indices such that the indices are close to\neach as described in \u003chttps://arxiv.org/pdf/2001.10500.pdf\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `seed` | An integer seed for hash functions. |\n| `table_size` | The hash table size of the IBLT. Must be a positive integer. |\n| `repetitions` | The number of repetitions in IBLT data structure. Must be at least 3. |\n| `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`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|----------------------------------------|\n| `ValueError` | If arguments do not meet expectations. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `get_hash_indices_tf`\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 get_hash_indices_tf(\n data_strings\n )\n\nReturns Tensor containing hash-position of `(input string, repetition)`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------------|-----------------------------------------------------------------------------------|\n| `data_strings` | A [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of strings. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| 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)`. ||\n\n\u003cbr /\u003e"]]