Commit graph

890 commits

Author SHA1 Message Date
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
A. Unique TensorFlower
f85c04c072 Merge pull request #26 from cclauss:patch-1
PiperOrigin-RevId: 237473163
2019-03-08 10:22:55 -08:00
Nicolas Papernot
be815437a6
reorder imports 2019-03-08 09:47:15 -08:00
cclauss
d9780c043e
from six.moves import xrange
__xrange()__ was removed in Python 3 in favor of a reworked version of __range()__.

[flake8](http://flake8.pycqa.org) testing of https://github.com/tensorflow/privacy on Python 3.7.1

$ __flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics__
```
./privacy/optimizers/gaussian_query_test.py:65:16: F821 undefined name 'xrange'
      for _ in xrange(1000):
               ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:79:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:106:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:139:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
4     F821 undefined name 'xrange'
4
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2019-03-08 10:35:01 +01:00
cclauss
1fc7128da0
from six.moves import xrange
__xrange()__ was removed in Python 3 in favor of a reworked version of __range()__.

[flake8](http://flake8.pycqa.org) testing of https://github.com/tensorflow/privacy on Python 3.7.1

$ __flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics__
```
./privacy/optimizers/gaussian_query_test.py:65:16: F821 undefined name 'xrange'
      for _ in xrange(1000):
               ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:79:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:106:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
./research/pate_2018/ICLR2018/rdp_bucketized.py:139:12: F821 undefined name 'xrange'
  for i in xrange(n):
           ^
4     F821 undefined name 'xrange'
4
```
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2019-03-08 10:33:26 +01:00
Nicolas Papernot
d226cf3172 update tutorial README
PiperOrigin-RevId: 237161576
2019-03-06 18:37:35 -08:00
Nicolas Papernot
fdd110b7df add a Penn TreeBank example
PiperOrigin-RevId: 237160380
2019-03-06 18:27:37 -08:00
Steve Chien
b892d650cf Tests for Eager mode.
PiperOrigin-RevId: 236382269
2019-03-01 14:48:29 -08:00
Nicolas Papernot
517584d7a6 add Keras tutorial
PiperOrigin-RevId: 236199395
2019-02-28 14:35:28 -08:00
Nicolas Papernot
0c691085e1 missing reduce_mean
PiperOrigin-RevId: 235858614
2019-02-26 22:56:29 -08:00
Galen Andrew
df6f065925 Correct license author string.
PiperOrigin-RevId: 235777655
2019-02-26 13:08:10 -08:00
Nicolas Papernot
c2d4b17881 Add support for the Eager mode
PiperOrigin-RevId: 235733975
2019-02-26 09:20:28 -08:00
Nicolas Papernot
bfba26801d Closes #16
PiperOrigin-RevId: 235070241
2019-02-21 14:34:27 -08:00
Steve Chien
f37c9d1ea1 Use mean loss within each microbatch.
PiperOrigin-RevId: 233832864
2019-02-13 14:42:12 -08:00
Eugene Brevdo
72305bcb10 Update use of tf.CriticalSection.
PiperOrigin-RevId: 233168852
2019-02-08 20:08:35 -08:00
Steve Chien
d75f1b80ba Fix copybara to limit some transformations to the beginning of the line.
PiperOrigin-RevId: 233151293
2019-02-08 16:55:57 -08:00
A. Unique TensorFlower
4d0ab48c35 Add privacy ledger.
The privacy ledger keeps a record of all sampling and query events for analysis post hoc by the privacy accountant.

PiperOrigin-RevId: 233094012
2019-02-08 11:21:43 -08:00
A. Unique TensorFlower
36d9959c19 internal change
PiperOrigin-RevId: 233093203
2019-02-08 11:17:09 -08:00
Ilya Mironov
d435fcbf9a Updating README.md to reflect ReLU activation function.
+ clean-up of mnist_dpsgd_tutorial

PiperOrigin-RevId: 232707393
2019-02-06 11:06:31 -08:00
Nicolas Papernot
8c99088cf1 add ReLUs to tutorial model
PiperOrigin-RevId: 232073877
2019-02-01 18:43:35 -08:00
A. Unique TensorFlower
098c5220b5 Remove test broken by upstream tf changes.
tf.nest.map_structure_up_to has changed so that map_structure_up_to(x, func, x, y) no longer raises an error when y is longer than x, for example x=[1,2], y=[1,2,3]. This broke one of our tests for nested query. Remove the test until (if and when) the old, more reasonable, behavior is restored.

PiperOrigin-RevId: 232057385
2019-02-01 16:22:05 -08:00
Ilya Mironov
ff295b6a70 Adding no-privacy baseline (dpsgd=False) to README.md.
PiperOrigin-RevId: 231004783
2019-01-25 18:37:11 -08:00
Nicolas Papernot
668888c1a6 change kernel initializer to fix dpsgd=False tutorial
PiperOrigin-RevId: 230931823
2019-01-25 10:59:51 -08:00
A. Unique TensorFlower
4f9cc8ef3e 1. Adding a CLI script for computing privacy loss for DP-SGD.
2. Fixing typos in the MNIST tutorial.

PiperOrigin-RevId: 230608908
2019-01-23 14:56:27 -08:00
Galen Andrew
c8cb3c6b70 General cleanup.
1. Rename PrivateQuery to DPQuery.
2. Move construction of DPQuery to outside of optimizer.
3. Remove PrivateAverageQuery and PrivateSumQuery, and rename DPQuery's 'get_query_result' method to 'get_noised_result'. Rename private_queries.py to dp_query.py.
4. Remove thrice-replicated run_query function from the test classes and replace with a single function in new test_utils.py.
5. Add functions gaussian_sum_query_from_noise_multplier and gaussian_average_query_from_noise_multplier.

PiperOrigin-RevId: 230595991
2019-01-23 14:41:44 -08:00
Steve Chien
7e2d796bde Minor fixes for Python 2/3 compatibility.
PiperOrigin-RevId: 230022543
2019-01-18 17:33:22 -08:00
Peter Kairouz
0b56f7c016 Add optional argument for weighted sum and weighted average queries.
PiperOrigin-RevId: 230021515
2019-01-18 17:25:58 -08:00
A. Unique TensorFlower
047e1eef0e Updating README.md for the tutorial. Included discussion of learning_rate and target accuracy/privacy for several settings of training parameters.
PiperOrigin-RevId: 230016922
2019-01-18 16:49:24 -08:00
Alex Pine
6c5c39c4f2 Created the optional unroll_microbatches parameter for the DpOptimizerClass as a workaround for b/122613513.
PiperOrigin-RevId: 229955297
2019-01-18 11:51:44 -08:00
A. Unique TensorFlower
87ec1a2e77 Merge pull request #14 from badbayesian:master
PiperOrigin-RevId: 229631674
2019-01-16 14:56:25 -08:00
Nicolas Papernot
4487099296 Closes #11
PiperOrigin-RevId: 229430188
2019-01-15 13:32:56 -08:00
badbayesian
e86cf16986 FIX: python3 compatibility 2019-01-15 14:54:28 -06:00