ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

tff.analytics.heavy_hitters.iblt.RandomHyperEdgeHasher

Hashes a string to a list of independently sampled indices.

For a string, generates a set of indices such that each index is independently sampled uniformly at random.

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 an integer at least 3.

ValueError If arguments do not meet expectations.

Methods

get_hash_indices

View source

Computes the indices at which data_strings in IBLT.

Args
data_strings A list of strings to be hashed.

Returns
hash_indices A vector of repetitions hash values of data_string, in {0,...,table_size-1}.

get_hash_indices_tf

View source

Returns a tf.Tensor containing the indices of input_string in IBLT.

Args
input_strings A 1-d tf.Tensor of strings.

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