Numeric computation of the privacy parameter in Gaussian Differential Privacy
Project description
gdpnum
Repository for numerically computing the privacy parameter in Gaussian Differential Privacy.
Quickstart
You can install the library with pip:
pip install gdpnum
DP-SGD
To analyze DP-SGD, we have:
import gdpnum
mu, regret = gdpnum.dpsgd.get_mu_and_regret_for_dpsgd(
noise_multiplier=9.4,
sample_rate=0.328,
num_steps=2000
)
# (1.5685621993129137, 0.0010208130697719753)
We get the numerically computed GDP mu parameter, and regret which shows the goodness-of-fit of the GDP.
The library also includes an Opacus-compatible accountant interface:
import gdpnum
acct = gdpnum.dpsgd.CTDAccountant()
acct.step(noise_multiplier=9.4, sample_rate=0.328)
acct.get_mu_and_regret()
General mechanisms
For general mechanisms, the library relies on the privacy loss distribution
objects from the dp_accounting package:
import gdpnum
pld = ...
converter = gdpnum.PLDConverter(pld)
mu, regret = converter.get_mu_and_regret()
See an example for the US Census TopDown mechanism in the notebooks folder.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gdpnum-0.1.0.tar.gz.
File metadata
- Download URL: gdpnum-0.1.0.tar.gz
- Upload date:
- Size: 124.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d569d6cb39cbeb87d5e450a8103138740f31d6733ab46a8dfb7afa14e3628591
|
|
| MD5 |
80774b0d38f78ece97d6a46772f410b2
|
|
| BLAKE2b-256 |
6697cbd8fad0f1ac84f4f9d4d2b0a408312f1498605c2d3186a2583ca25272ea
|
File details
Details for the file gdpnum-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gdpnum-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d10e62b747be59b3eab9bd6b07661566b154899d5b9c8fa0dd75f98844da7373
|
|
| MD5 |
e9407612a842d092af1e9db84d575a5f
|
|
| BLAKE2b-256 |
7b093189b4c3e81e4e6b7702bad214046bcc75f9d3a55041471fd924d8a3ca8e
|