Skip to main content

Numeric computation of the privacy parameter in Gaussian Differential Privacy

Project description

gdpnum

CI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdpnum-0.1.0.tar.gz (124.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gdpnum-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for gdpnum-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d569d6cb39cbeb87d5e450a8103138740f31d6733ab46a8dfb7afa14e3628591
MD5 80774b0d38f78ece97d6a46772f410b2
BLAKE2b-256 6697cbd8fad0f1ac84f4f9d4d2b0a408312f1498605c2d3186a2583ca25272ea

See more details on using hashes here.

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

Hashes for gdpnum-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d10e62b747be59b3eab9bd6b07661566b154899d5b9c8fa0dd75f98844da7373
MD5 e9407612a842d092af1e9db84d575a5f
BLAKE2b-256 7b093189b4c3e81e4e6b7702bad214046bcc75f9d3a55041471fd924d8a3ca8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page