Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
86c1405c
Commit
86c1405c
authored
Nov 01, 2016
by
Nicolas Papernot
Browse files
make large files downloadable
parent
23aaaad4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
privacy/analysis.py
privacy/analysis.py
+21
-0
privacy/input.py
privacy/input.py
+4
-0
No files found.
privacy/analysis.py
View file @
86c1405c
...
...
@@ -23,10 +23,13 @@ python analysis.py
--max_examples=1000
--delta=1e-6
"""
import
os
import
math
import
numpy
as
np
import
tensorflow
as
tf
from
input
import
maybe_download
# These parameters can be changed to compute bounds for different failure rates
# or different model predictions.
...
...
@@ -194,6 +197,24 @@ def smoothed_sens(counts, noise_eps, l, beta):
def
main
(
unused_argv
):
##################################################################
# If we are reproducing results from paper https://arxiv.org/abs/1610.05755,
# download the required binaries with label information.
##################################################################
# Binaries for MNIST results
paper_binaries_mnist
=
\
[
"https://github.com/npapernot/multiple-teachers-for-privacy/blob/master/mnist_250_teachers_labels.npy?raw=true"
,
"https://github.com/npapernot/multiple-teachers-for-privacy/blob/master/mnist_250_teachers_100_indices_used_by_student.npy?raw=true"
]
if
FLAGS
.
counts_file
==
"mnist_250_teachers_labels.npy"
\
or
FLAGS
.
indices_file
==
"mnist_250_teachers_100_indices_used_by_student.npy"
:
maybe_download
(
paper_binaries_mnist
,
os
.
getcwd
())
# Binaries for SVHN results
paper_binaries_svhn
=
[
"https://github.com/npapernot/multiple-teachers-for-privacy/blob/master/svhn_250_teachers_labels.npy?raw=true"
]
if
FLAGS
.
counts_file
==
"svhn_250_teachers_labels.npy"
:
maybe_download
(
paper_binaries_svhn
,
os
.
getcwd
())
input_mat
=
np
.
load
(
FLAGS
.
counts_file
)
if
FLAGS
.
input_is_counts
:
counts_mat
=
input_mat
...
...
privacy/input.py
View file @
86c1405c
...
...
@@ -62,6 +62,10 @@ def maybe_download(file_urls, directory):
# Extract filename
filename
=
file_url
.
split
(
'/'
)[
-
1
]
# If downloading from GitHub, remove suffix ?raw=True from local filename
if
filename
.
endswith
(
"?raw=true"
):
filename
=
filename
[:
-
9
]
# Deduce local file url
#filepath = os.path.join(directory, filename)
filepath
=
directory
+
'/'
+
filename
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment