(WIP) Support to PLD composition #259#405
Draft
ricardocarvalhods wants to merge 2 commits intoOpenMined:mainfrom
Draft
(WIP) Support to PLD composition #259#405ricardocarvalhods wants to merge 2 commits intoOpenMined:mainfrom
ricardocarvalhods wants to merge 2 commits intoOpenMined:mainfrom
Conversation
dvadym
reviewed
Feb 24, 2023
Collaborator
dvadym
left a comment
There was a problem hiding this comment.
Thanks! It looks good. I left some comments.
Please add tests for apply_laplace/gaussian with std_deviation (no need to add tests for all function count/sum etc), because after the next refactoring they will be removed
| delta: The delta value. | ||
| l2_sensitivity: The L2 sensitivity. | ||
| """ | ||
| # TODO: use named arguments, when argument names are added in PyDP on PR |
Collaborator
There was a problem hiding this comment.
Thanks for fixing this TODO
| mechanism = dp_mechanisms.LaplaceMechanism(epsilon=eps, | ||
| sensitivity=l1_sensitivity) | ||
| if noise_standard_deviation is not None: | ||
| mechanism = dp_mechanisms.LaplaceMechanism(epsilon=1 / |
Collaborator
There was a problem hiding this comment.
Please add comment that here workaround is used, since we can't set the Laplace parameter directly
| mechanism = MechanismSpec(MechanismType.LAPLACE) | ||
| print(mechanism.noise_standard_deviation()) | ||
| mechanism = MechanismSpec(MechanismType.LAPLACE) | ||
| self.assertEqual(None, mechanism.noise_standard_deviation) |
| count_noise_standard_deviation = \ | ||
| sum_noise_standard_deviation = \ | ||
| 2*dp_params.noise_standard_deviation \ | ||
| if dp_params.noise_standard_deviation is not None \ |
Collaborator
There was a problem hiding this comment.
Nit: maybe something like that
noise_std = None
if dp_params.noise_standard_deviation is not None:
noise_std = 2*dp_params.noise_standard_deviation
count_noise_standard_deviation = sum_noise_standard_deviation = noise_std
| value: float, | ||
| eps: float, | ||
| delta: float, | ||
| noise_standard_deviation: float, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Solving "Advance composition in PipelineDP" #259
The approach I'm using is:
Tasks:
Additionally:
dp_computations.pyand formatting.request_budgetreceivesnoise_standard_deviation, do you know why? not sure if it is needed, asnoise_standard_deviationis only calculated in compute_budgets.