jax_privacy.experimental.monte_carlo.sample_generation.compute_privacy_loss#
- jax_privacy.experimental.monte_carlo.sample_generation.compute_privacy_loss(strategy, sample, noise_multiplier, c_col, aux=None, mode_scale=1.0)[source]#
Computes the privacy loss on a sample from the dominating pair.
This method reports the privacy loss assuming we sample from the distribution in the dominating pair where the sensitive example is included. To get the privacy loss for when the example is excluded, we simply negate the privacy loss for the positive sample.
- Parameters:
strategy (
BallsInBinsSampling|BMinSepSampling|CyclicPoissonSampling) – The batch selection strategy used to generate the sample. Currently,BallsInBinsSampling,CyclicPoissonSampling(usingINDEPENDENTpartition type), andBMinSepSamplingare supported. See Choquette-Choo et al. (2024) and Dong and Ganesh (2026) for technical details.sample (
ndarray) – The samples, generated bygenerate_sample().noise_multiplier (
float) – The noise multiplier of DP-MF. This is multiplied by the clip norm, not accounting for the norm ofc_col.c_col (
ndarray) – The non-zero entries in the first column of C. Should be non-negative and 1D. Assumed to match the epoch length of balls-in-bins.aux (
ndarray|None) – Auxiliary information needed to compute the privacy loss.mode_scale (
float) – A scalar \(w\) by which the modes of the positive mixture \(P\) are multiplied. The returned value is then \(\ln(P_w(y) / Q(y))\), where \(P_w\) is the stretched mixture (with \(P_1 = P\)) and \(Q\) is the negative distribution. This is used to compute importance weights for samples drawn from \(P_w\). Currently only supported for balls-in-bins sampling.
- Return type:
ndarray- Returns:
The privacy loss of the sample, assuming we sample from the distribution in the dominating pair where the sensitive example is included.