-
Notifications
You must be signed in to change notification settings - Fork 191
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
Code for the Location Heatmaps paper. #47
Open
ebagdasa
wants to merge
13
commits into
google-research:master
Choose a base branch
from
ebagdasa:old_m
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5cd1d21
Updates to the Location Heatmaps code.
ebagdasa bb7372a
Created using Colaboratory
ebagdasa b377c5e
addressing PR comments
ebagdasa 2eef817
clarify metrics
ebagdasa b87b69b
refactor split code
ebagdasa 559225c
update gaussian code
ebagdasa 56f0dce
fixes
ebagdasa e0e3fbe
Created using Colaboratory
ebagdasa ec363b4
address PR comments
ebagdasa 009edfd
addressed comments
ebagdasa 92826fb
addressed comments
ebagdasa d2697fd
Created using Colaboratory
ebagdasa 8c6890d
updated readme
ebagdasa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
# Location Heatmaps | ||
# Towards Sparse Federated Analytics: Location Heatmaps under Distributed Differential Privacy with Secure Aggregation | ||
|
||
This directory contains work-in-progress code to experiment with differential | ||
privacy on location heatmaps. | ||
This directory contains code to experiment with differential | ||
privacy on location heatmaps and based on [this paper](https://arxiv.org/abs/2111.02356). | ||
Here is the example of the algorithm running on NYC location map from | ||
[NYTimes](https://www.nytimes.com/2018/12/14/reader-center/phone-data-location-investigation.html): | ||
|
||
![Alt Text](animation.gif) | ||
|
||
To experiment with the code there is a working [notebook](dp_location_heatmaps.ipynb) | ||
with all the examples from the paper, please don't hesitate to contact the | ||
[author](mailto:eugene@cs.cornell.edu) or raise an issue.1 | ||
|
||
For citation: | ||
``` | ||
@misc{bagdasaryan2021sparse, | ||
title={Towards Sparse Federated Analytics: Location Heatmaps under Distributed Differential Privacy with Secure Aggregation}, | ||
author={Eugene Bagdasaryan and Peter Kairouz and Stefan Mellem and Adrià Gascón and Kallista Bonawitz and Deborah Estrin and Marco Gruteser}, | ||
year={2021}, | ||
eprint={2111.02356}, | ||
archivePrefix={arXiv}, | ||
primaryClass={cs.CR} | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import dataclass | ||
from typing import List, Any | ||
import numpy as np | ||
TOPK = 1000 | ||
TOTAL_SIZE = 1024 | ||
|
||
|
||
@dataclass | ||
class Config: | ||
dataset: List | ||
image: Any | ||
level_sample_size: int = 10000 | ||
secagg_round_size: int = 10000 | ||
threshold: float = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about 'split_threshold' to contrast with 'collapse_threshold' below? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
collapse_threshold: float = None | ||
eps_func: Any = lambda x, y: 1 | ||
total_epsilon_budget: float = None | ||
top_k: int = TOPK | ||
partial:int = 100 | ||
max_levels: int = 10 | ||
threshold_func: Any = None | ||
collapse_func: Any = None | ||
total_size: int = TOTAL_SIZE | ||
min_dp_size: int = None | ||
dropout_rate: int = None | ||
output_flag: int = True | ||
quantize: bool = None | ||
noise_class: Any = None | ||
save_gif: bool = False | ||
positivity: bool = False | ||
start_with_level: int = 0 |
14,840 changes: 14,840 additions & 0 deletions
14,840
analytics/location_heatmaps/dp_location_heatmaps.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraneous '1' at end of line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed