Utils

opacus.accountants.utils.get_noise_multiplier(*, target_epsilon, target_delta, sample_rate, epochs=None, steps=None, accountant='rdp', epsilon_tolerance=0.01, **kwargs)[source]

Computes the noise level sigma to reach a total budget of (target_epsilon, target_delta) at the end of epochs, with a given sample_rate

Parameters:
  • target_epsilon (float) – the privacy budget’s epsilon

  • target_delta (float) – the privacy budget’s delta

  • sample_rate (float) – the sampling rate (usually batch_size / n_data)

  • epochs (Optional[int]) – the number of epochs to run

  • steps (Optional[int]) – number of steps to run

  • accountant (str) – accounting mechanism used to estimate epsilon

  • epsilon_tolerance (float) – precision for the binary search

Return type:

float

Returns:

The noise level sigma to ensure privacy budget of (target_epsilon, target_delta)