Commit graph

421 commits

Author SHA1 Message Date
Steve Chien
17fefb3895 Remove tf.function annotation from quantile_adaptive_clip_sum_query.py that was causing import error.
PiperOrigin-RevId: 248236331
2019-05-14 16:40:55 -07:00
Galen Andrew
aaf029edad Add quantile_adaptive_clip_sum_query which dynamically adjusts the clipping norm so a specified fraction of records per sample are clipped.
PiperOrigin-RevId: 248201320
2019-05-14 13:35:29 -07:00
Galen Andrew
1d1a6e087a Extensions to DPQuery and subclasses.
1. Split DPQuery.accumulate_record function into preprocess_record and accumulate_preprocessed_record.
2. Add merge_sample_state function.
3. Add default implementations for some functions in DPQuery, and add base class SumAggregationDPQuery that implements some more. Only get_noised_result is still abstract.
4. Enforce that all states and parameters used as inputs and outputs to DPQuery functions are nested structures of tensors by replacing numbers with constants and Nones with empty tuples.

PiperOrigin-RevId: 247975791
2019-05-13 11:28:56 -07:00
Steve Chien
82852c0e71 Add comments explaining the relationship between ML terminology and DP terminology.
PiperOrigin-RevId: 246926753
2019-05-06 17:12:24 -07:00
Ilya Mironov
9cece21d92 Clean-up pass to eliminate warnings: replacing deprecated endpoints with recommended versions and annotating test sizes.
PiperOrigin-RevId: 246901723
2019-05-06 14:50:23 -07:00
Ilya Mironov
85280ab568 Removing max_samples and max_queries from the tutorial.
PiperOrigin-RevId: 246850557
2019-05-06 10:30:35 -07:00
Steve Chien
098940bf1b Very minor formatting change.
PiperOrigin-RevId: 246596295
2019-05-03 16:41:38 -07:00
Steve Chien
28639ba0a8 Allow tensor buffers to automatically resize as needed.
PiperOrigin-RevId: 246594454
2019-05-03 16:30:02 -07:00
Steve Chien
beb86c6e18 Update PrivacyLedger and DPOptimizer to make certain arguments optional.
PiperOrigin-RevId: 246235646
2019-05-01 18:07:32 -07:00
Nicolas Papernot
c09ec4c22b minor fixes to improve tf 1 and 2 compatibility
PiperOrigin-RevId: 246008822
2019-04-30 13:22:57 -07:00
Nicolas Papernot
febafd830d update API calls for TF2
PiperOrigin-RevId: 245817981
2019-04-29 14:00:40 -07:00
A. Unique TensorFlower
ab466b156c Check batch_size % microbatches = 0 and calculate privacy budget only when dpsgd is set.
PiperOrigin-RevId: 244949900
2019-04-23 16:40:33 -07:00
Ilya Mironov
a3e03f773e Adding a paragraph to the walk-through on how to choose RDP orders. Plus deleting empty lines in rdp_accountant.py. Fixing issue #47.
PiperOrigin-RevId: 244467825
2019-04-19 21:50:49 -07:00
Steve Chien
31219a5f3f Fix DP optimizers to handle gradients that are None.
PiperOrigin-RevId: 244429987
2019-04-19 15:07:55 -07:00
A. Unique TensorFlower
134b7d2093 Merge pull request #45 from splatonline:ledger
PiperOrigin-RevId: 244412992
2019-04-19 13:33:57 -07:00
Galen Andrew
28df9cf233 Add missing deps to privacy __init__.py.
PiperOrigin-RevId: 244249099
2019-04-18 13:39:09 -07:00
Tim Garnsey
aeb6a94b59 added a ledger during optimizer instantiation to the language model tutorial 2019-04-17 12:52:08 +10:00
Ilya Mironov
51e29667d9 Fixing issue #44 (imports in privacy/__init__.py). Added __init__.py to the dp_query directory for Python 2 compatibility.
PiperOrigin-RevId: 243329997
2019-04-12 14:10:48 -07:00
Ilya Mironov
3c4409d6d6 Restoring ability to run compute_dp_sgd_privacy.py as a standalone script.
At present, the script has no heavy dependencies except for the rdp_accountant, which is by itself pretty light-weight. However, importing rdp_accountant triggers __init__.py in third_party/py/tensorflow_privacy/privacy, which loads TF and all of tf.privacy. The CL adds a check to the __init__.py, which controls this behavior.

PiperOrigin-RevId: 243172355
2019-04-11 17:06:53 -07:00
Galen Andrew
e8113a0365 Add DummyOptimizer to top-level imports.
PiperOrigin-RevId: 242715034
2019-04-09 12:14:22 -07:00
Steve Chien
3dc2b398d2 Closes #41
PiperOrigin-RevId: 241786994
2019-04-03 12:48:25 -07:00
Galen Andrew
9106a04e2c Use PrivacyLedger for privacy accounting.
Prior to this change the PrivacyLedger is running to keep a log of private queries, but the ledger is not actually used to compute the (epsilon, delta) guarantees. This CL adds a function to compute the RDP directly from the ledger.

Note I did verify that the tutorial builds and runs with the changes and for the first few iterations prints the same epsilon values as before the change.

PiperOrigin-RevId: 241063532
2019-03-29 15:31:32 -07:00
Nicolas Papernot
8507094f2b add walkthrough MD
PiperOrigin-RevId: 241016765
2019-03-29 11:24:36 -07:00
A. Unique TensorFlower
a8e54d928c Merge pull request #37 from ShadiRahimian:patch-1
PiperOrigin-RevId: 240601653
2019-03-27 11:13:33 -07:00
Nicolas Papernot
01e7cac7b5
Update compute_dp_sgd_privacy.py 2019-03-27 09:22:58 -07:00
Nicolas Papernot
8db2dd6bca
Update compute_dp_sgd_privacy.py 2019-03-27 09:18:45 -07:00
Nicolas Papernot
03050adb27 adding scratch for walkthrough blog post
PiperOrigin-RevId: 240425310
2019-03-26 14:16:27 -07:00
Shadi Rahimian
0a0e5cb3c3
line 83 produces error
TypeError: can only concatenate list (not "range") to list
2019-03-26 15:28:09 +01:00
Galen Andrew
6231d0802d Cleanup directory structure, add top-level imports and add normalized_query.
Moved query classes from dir optimizers into new dir dp_query. Added NormalizedQuery class for queries that divide the output of another query by a constant like GaussianAverageQuery.

PiperOrigin-RevId: 240167115
2019-03-25 10:21:04 -07:00
Nicolas Papernot
3c1e9994eb fix vector loss issue with Keras by instantiate a loss object
PiperOrigin-RevId: 239483918
2019-03-20 15:08:58 -07:00
Nicolas Papernot
0ebd134d99 Closes #33
PiperOrigin-RevId: 239129202
2019-03-18 22:42:01 -07:00
Galen Andrew
0aad84ab3f Move mpmath dependency to unittest target that uses it, and explicit import of mpmath functions to reduce size.
PiperOrigin-RevId: 239056360
2019-03-18 14:03:47 -07:00
Nicolas Papernot
a1e9ca2a18 Closes #32
PiperOrigin-RevId: 239054994
2019-03-18 13:58:07 -07:00
Nicolas Papernot
f58891f3e3 Closes #25
PiperOrigin-RevId: 239031260
2019-03-18 11:55:00 -07:00
Nicolas Papernot
a9840529c4 Closes #29
PiperOrigin-RevId: 239030654
2019-03-18 11:54:20 -07:00
A. Unique TensorFlower
8fc35f9ca3 Merge pull request #31 from an1006634493:patch-1
PiperOrigin-RevId: 239029264
2019-03-18 11:44:36 -07:00
npapernot
2aa9debb91 glint 2019-03-18 17:01:25 +00:00
npapernot
a209988d87 docstrings 2019-03-18 16:58:06 +00:00
npapernot
e55a832d54 fnames 2019-03-18 16:49:34 +00:00
npapernot
b6c932ec66 quotes 2019-03-18 16:47:36 +00:00
npapernot
4784b0f31e pylint edits 2019-03-18 16:42:59 +00:00
Nicolas Papernot
ec2204ac97
rename var 2019-03-18 09:27:57 -07:00
Nicolas Papernot
38ae6ce3b3
reorder imports 2019-03-18 09:23:59 -07:00
Nicolas Papernot
0b5780b4e6
Update input.py 2019-03-18 09:22:38 -07:00
Nicolas Papernot
469c2da8c4
Update input.py 2019-03-18 09:21:04 -07:00
Nicolas Papernot
d139d94f32
Update input.py 2019-03-18 07:29:18 -07:00
an1006634493
5bac796ee6
Record one change for Python3
In Python 3, cPickle is replaced by pickle.
2019-03-18 22:09:46 +08:00
Galen Andrew
9a53e1eb86 Adds AdaptiveClipAverageQuery which performs adaptive adjustment of the clipping norm to approximate a specified quantile of clipped updates per round.
PiperOrigin-RevId: 238698171
2019-03-15 13:19:22 -07:00
Nicolas Papernot
947e17dcce Closes #28
PiperOrigin-RevId: 238274605
2019-03-13 11:56:31 -07:00
Galen Andrew
e566967ff6 Simplify GaussianQuery by removing _GlobalState.
The global state for DP query is intended for aspects of the query that change across samples under the query's own control. It was therefore unnecessary to wrap "l2_norm_clip" and "sum_stddev" in the namedtuple _GlobalState for the basic GaussianQuery classes.

PiperOrigin-RevId: 237528962
2019-03-08 15:17:48 -08:00