From 0e04e1baebb41dd2f9e0db5144af1a26256d247d Mon Sep 17 00:00:00 2001 From: Galen Andrew Date: Wed, 25 Aug 2021 19:06:51 -0700 Subject: [PATCH] Adding NonPrivateDpEvent and UnsupportedDpEvent. PiperOrigin-RevId: 393028308 --- .../privacy/analysis/dp_event.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tensorflow_privacy/privacy/analysis/dp_event.py b/tensorflow_privacy/privacy/analysis/dp_event.py index fbec1d1..da027e9 100644 --- a/tensorflow_privacy/privacy/analysis/dp_event.py +++ b/tensorflow_privacy/privacy/analysis/dp_event.py @@ -37,6 +37,27 @@ class NoOpDpEvent(DpEvent): """ +@attr.s(frozen=True) +class NonPrivateDpEvent(DpEvent): + """A `DpEvent` to represent non-private operations. + + This `DpEvent` should be used when an operation is performed that does not + satisfy (epsilon, delta)-DP. All `PrivacyAccountant`s should return infinite + epsilon/delta when encountering a `NonPrivateDpEvent`. + """ + + +@attr.s(frozen=True) +class UnsupportedDpEvent(DpEvent): + """A `DpEvent` to represent as-yet unsupported operations. + + This `DpEvent` should be used when an operation is performed that does not yet + have any associated DP description, or if the description is temporarily + inaccessible, for example, during development. All `PrivacyAccountant`s should + return `is_supported(event)` is `False` for `UnsupportedDpEvent`. + """ + + @attr.s(frozen=True, slots=True, auto_attribs=True) class GaussianDpEvent(DpEvent): """The Gaussian mechanism."""