Skip to main content

Subsampling transformations and utilities for Privacy Loss Distribution (PLD) PMFs

Project description

PLD_subsampling

Implements and evaluates privacy amplification by subsampling for Privacy Loss Distribution (PLD) probability mass functions (PMFs). Generates CDF plots and epsilon ratio plots comparing analytical ground truth, dp-accounting, and our direct subsampling implementation.

Package layout

  • PLD_subsampling/
    • PLD_subsampling.py: Core subsampling primitives
      • stable_subsampling_loss: numerically stable loss mapping
      • exclusive_ccdf_from_pdf: CCDF helper (exclusive tail)
      • subsample_losses: transforms a PMF on a uniform loss grid
    • wrappers/dp_accounting_wrappers.py: Thin wrappers around dp-accounting (construct PLDs, amplify PLDs separately for remove/add), plus PMF bridge utilities
    • testing/
      • analytic_Gaussian.py: Analytical PLD and epsilon(δ) formulas for Gaussian mechanism
      • test_utils.py: Builds method variants for experiments, parameterized run_all_experiments
      • plot_utils.py: Plotting (CDF with focused x-range, epsilon ratio)
    • main.py: Runs experiments and saves figures to plots/

Quickstart

  1. Create a virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
  1. Run experiments and generate plots
python -m PLD_subsampling.main

Figures are written to plots/ (treat this directory as build output).

Notes

  • CDF plots automatically focus the main x-axis on the transition region and add slight y-padding to show the 0 and 1 limits clearly.
  • Epsilon-ratio plots show method/GT vs analytical epsilon over log-scale epsilon.
  • All heavy computations use vectorized NumPy operations with careful numerical handling in tail regions.

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

pld_subsampling-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

pld_subsampling-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file pld_subsampling-0.1.0.tar.gz.

File metadata

  • Download URL: pld_subsampling-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for pld_subsampling-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17e313716866b402312a02bff1a4a8f1d55127b8b65eacd681479141792344d1
MD5 4ff2a11a86371978d972984f66f3cfe8
BLAKE2b-256 51812cc64b2872542587c58d09609a51fdd700f6936f9a58624666e4892c9f16

See more details on using hashes here.

File details

Details for the file pld_subsampling-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pld_subsampling-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e94d4d71f9c5044b97c8dfa11f324c1c15375ddf7576025444a36a0194887e37
MD5 59659b8af9dfcf48908e7aa3f114f776
BLAKE2b-256 aee9a15d1cf0e606cae4e9775615238d45dab91434506b67d0860e0b5ae114f4

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