PyDP icon indicating copy to clipboard operation
PyDP copied to clipboard

FEAT: Expose SeededLaplaceMechanism for deterministic RNG

Open mjbommar opened this issue 3 years ago • 4 comments

Feature Description

For research and CI/CD testing purposes, full transparency or determinism w.r.t. random state is often desirable. differential-privacy makes a SeededLaplaceMechanism available for this purpose, but it looks like we only make LaplaceMechanism available in this library.

Is your feature request related to a problem?

Two issues:

  • Replication of academic research that relies on exact reproduction of sample data
  • CI/CD testing workflows where deterministic results for some test cases may be desirable

What alternatives have you considered?

Alternatives rely on asymptotic results and thresholds that may be arbitrary or result in false negative test results, especially on small sample sizes or for some metrics.

mjbommar avatar Jan 30 '22 11:01 mjbommar

PS: this looks pretty trivial but happy to help implement too!

mjbommar avatar Jan 30 '22 11:01 mjbommar

I thought I could PR this in 15 minutes but ran into an issue. I see that the SeededXYZ mechanisms are in numerical-mechanisms-testing.h, not numerical-mechanisms.h, which results in them being blocked from linking due to bazel's testonly behavior. I guess the options are to "re-implement" the seeded behavior or explore moving these Mechanisms in the differential-privacy repo itself.

Open to thoughts (or just closing as Won't Fix).

mjbommar avatar Feb 07 '22 21:02 mjbommar

@dvadym what do you think about this?

chinmayshah99 avatar Aug 09 '22 03:08 chinmayshah99

I think this is a good feature to have, it can be definitely useful for some use cases.

dvadym avatar Aug 09 '22 06:08 dvadym