Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PolyaEstimateNoiser #115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pasin30055
Copy link
Contributor

Add PolyaMechanism and PolyaEstimateNoiser for adding a difference of two Polya noises to the input.

Note that, since we never use Polya alone (and hence there is no formal privacy proofs for the mechanism by itself), the initialization is done through the Polya parameters, rather than the privacy parameters.

Copy link
Collaborator

@jiayu-google jiayu-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clear, thanks Pasin!

Copy link
Member

@kungfucraig kungfucraig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but please update the comment copy-pasta as requested.

"""A noiser that adds a difference of two Polya noises to a cardinality estimate."""

def __init__(self, r, p, random_state=None):
"""Instantiates a GaussianEstimateNoiser object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Gaussian/Polya

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

lambda x: x, r, p, random_state=random_state)

def __call__(self, cardinality_estimate):
"""Returns a cardinality estimate with Gaussian noise."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Gaussian/Polya

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@pasin30055
Copy link
Contributor Author

Thanks for the catches Craig. Fixed now.

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.

3 participants