-
Notifications
You must be signed in to change notification settings - Fork 36
Description
DP mechanisms typically have randomness in two places: batch selection and noise addition. Some programs that use Jax privacy may also require internal randomness, although this randomness does not typically affect the privacy guarantee. By default Jax privacy uses numpy pseudo-random number generation for batch selection, and Jax pseudo-random number generation with explicit key management.
The randomgen library can be used for generating crypographically secure random values, and conforms to the same API as numpy. This can offer a drop-in replacement for batch_selection and used via dependency injection by Jax privacy users. For noise_addition, this library can be used to generate normal random values in numpy (on CPU). For efficiency, this should be done asyncronously with the calculation + accumulation of per-example clipped gradients (which occurs on GPU/TPU).
Task:
- Add a new example binary that demonstrates DP training with cryptographically secure randomness, adding useful reusable components to the Jax privacy library as necessary/helpful.