tree: 058515894bc56e6326a61d95c69bd3ebae0db8bd [path history] [tgz]
  1. dp_accounting/
  2. .bazelversion
  3. accounting_py_deps.bzl
  4. accounting_py_deps_init.bzl
  5. BUILD.bazel
  6. README.md
  7. requirements.txt
  8. setup.py
  9. VERSION
  10. WORKSPACE
python/README.md

Differential Privacy Accounting

This directory contains tools for tracking differential privacy budgets, available as part of the Google differential privacy library.

The set of DpEvent classes allow you to describe complex differentially private mechanisms such as Laplace and Gaussian, subsampling mechanisms, and their compositions. The PrivacyAccountant classes can ingest DpEvents and return the ε, δ of the composite mechanism. Privacy Loss Distributions (PLDs) and RDP accounting are currently supported.

More detailed definitions and references about PLDs can be found in our supplementary pdf document.

Our library only support Python version >= 3.9. We test this library on Linux with Python version 3.9. If you experience any problems, please file an issue on GitHub, also for other platforms or Python versions.

Examples

We provide basic examples on how to use the library in privacy_loss_distribution_basic_example.py. There are two ways to run this, either via Bazel or after installing the library using setup.py.

Run with Bazel

For running the example using Bazel, you need to have Bazel installed. Once that is done, run:

bazel build dp_accounting:all
bazel run dp_accounting:privacy_loss_distribution_basic_example

Run via setup.py

For the second option, you will need the setuptools package installed. To ensure this, you may run

pip install --upgrade setuptools

Then, to demonstrate our example, run:

python setup.py install
python dp_accounting/privacy_loss_distribution_basic_example.py