tf_privacy.tree_aggregation.GaussianNoiseGenerator

Gaussian noise generator with counter as pseudo state.

Inherits From: ValueGenerator

Produces i.i.d. spherical Gaussian noise at each step shaped according to a nested structure of tf.TensorSpecs.

noise_std The standard deviation of the noise.
specs A nested structure of tf.TensorSpecs specifying the shape of the noise to generate.
seed An optional integer seed. If None, generator is seeded from the clock.

Methods

initialize

View source

Makes an initial state for the GaussianNoiseGenerator.

Returns
A named tuple of (seeds, stddev).

make_state

View source

Returns a new named tuple of (seeds, stddev).

next

View source

Gets next value and advances the GaussianNoiseGenerator.

Args
state The current state (seed, noise_std).

Returns
A tuple of (sample, new_state) where sample is a new sample and new_state is the advanced state (seed+1, noise_std).