jax_privacy.experimental.monte_carlo.sample_generation.get_privacy_loss_sample#
- jax_privacy.experimental.monte_carlo.sample_generation.get_privacy_loss_sample(strategy, noise_multiplier, c_col, seed=None, positive_sample=True, num_samples=1, dataset_size=None)[source]#
Returns sample(s) from DP-BandMF’s dominating privacy loss distribution.
- Parameters:
strategy (
BallsInBinsSampling|BMinSepSampling|CyclicPoissonSampling) – The batch selection strategy to use. Currently,BallsInBinsSampling,CyclicPoissonSampling(usingINDEPENDENTpartition type), andBMinSepSamplingare supported. See Choquette-Choo et al. (2024) and Dong and Ganesh (2026) for technical details.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.seed (
int|Generator|None) – The seed to use for sampling.positive_sample (
bool) – IfTrue, we sample from the distribution in the dominating pair corresponding to the case where the sensitive example is included. Otherwise, we sample from the other case in the dominating pair, where the sensitive example is not included.num_samples (
int) – The number of samples to generate. The default is 1, but it is typically much more efficient to generate multiple samples in a single call to benefit from vectorization.dataset_size (
int|None) – The size of the dataset. Should only be set if accounting for the strategy supports truncation, andstrategy.truncated_batch_sizeis notNone.
- Return type:
tuple[ndarray,ndarray|tuple[ndarray,ndarray]]- Returns:
A tuple of (i) privacy loss of the sample(s), and (ii) either the sample(s) or a tuple of (sample(s), auxiliary information needed to compute the privacy loss).