Skip to content

Update mechanism.py to work with opendp noise mechanisms for aim and mst#102

Open
tjh2822 wants to merge 2 commits intoryan112358:masterfrom
tjh2822:feature/update_noise_mechanisms_for_aim_and_mst
Open

Update mechanism.py to work with opendp noise mechanisms for aim and mst#102
tjh2822 wants to merge 2 commits intoryan112358:masterfrom
tjh2822:feature/update_noise_mechanisms_for_aim_and_mst

Conversation

@tjh2822
Copy link
Contributor

@tjh2822 tjh2822 commented Mar 18, 2026

Replaces gaussian noise, laplace noise, exponential and permute and flip with OpenDP's make_noisy_max to eliminate floating-point vulnerabilities found in np.exp/softmax.

Changes:

  • Refactor gaussian and laplace mechanisms
  • Adds bounded flag for AIM
  • Refactor MST into MSTMechanism class that inherits from Mechanism
  • Add gaussian noise scale zcdp
  • Couple of misc fixes like removing unused matplotlib import

Further improvements:

  • pandas is a dependency of mechanisms/ but is not listed in the pyproject.toml. I chose to emulate this pattern for OpenDP but we could add them both to the dev group or an additional install target?
  • I left out MWEM and some of the other mechanisms

To test I ran some round-trip tests for AIM and MST as a part of a downstream program. I ran a quick test of the noise distribution properties for the updated noise mechanisms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant