jax_privacy.accounting.fixed_dpsgd_event
- jax_privacy.accounting.fixed_dpsgd_event(noise_multiplier, iterations, *, dataset_size, batch_size, replace=False, use_zcdp=False)[source]
Returns the DpEvent for DP-SGD with fixed-size sampling.
This mechanism samples a fixed-size batch at each iteration and applies a Gaussian mechanism to the aggregated gradients. It is equivalent to DP-SGD with fixed-size sampling.
Note: The without-replacement event is compatible with the RDP accountant under the REPLACE_ONE neighboring relation. Sampled-with-replacement events may not be supported by all accountants.
- Parameters:
noise_multiplier (
float) – The noise multiplier of the mechanism.iterations (
int) – The number of iterations to run the mechanism for.dataset_size (
int) – The number of examples in the dataset.batch_size (
int) – The fixed batch size per iteration.replace (
bool) – Whether to sample with replacement.use_zcdp (
bool) – Whether to use generic dp_event.ZCDpEvent instead of specific dp_event.GaussianDpEvent. For example, set this to True if using discrtete Gaussian noise instead of continuous Gaussian noise.
- Return type:
DpEvent- Returns:
A DpEvent object.