Michael Reneer
fd242e76b9
Internal
...
PiperOrigin-RevId: 425430059
2022-01-31 12:17:02 -08:00
Michael Reneer
36b8ea34ef
Internal
...
PiperOrigin-RevId: 424965569
2022-01-28 15:01:34 -08:00
Michael Reneer
25571aaf87
Fix up remaining lint and format in TensorFlow Privacy.
...
PiperOrigin-RevId: 424948247
2022-01-28 13:44:12 -08:00
Michael Reneer
b37aef1751
Fixed some lint errors in TensorFlow Privacy.
...
* Fixed `g-backslash-continuation`
* Fixed `g-generic-assert`
* Fixed `g-generic-assert`
* Fixed `raise-missing-from`
* Fixed `unused-argument`
PiperOrigin-RevId: 424931881
2022-01-28 12:31:00 -08:00
Michael Reneer
e6536597c5
Fixed some lint errors in TensorFlow Privacy.
...
* Fixed `g-importing-member`
* Fixed `g-bad-import-order`
PiperOrigin-RevId: 424926847
2022-01-28 12:10:05 -08:00
Michael Reneer
943ef91ee9
Format TensorFlow Privacy files.
...
PiperOrigin-RevId: 424923635
2022-01-28 11:57:24 -08:00
Michael Reneer
07230a161a
Internal
...
PiperOrigin-RevId: 424922009
2022-01-28 11:50:35 -08:00
Michael Reneer
7396ad62da
Update TensorFlow Privacy to use Python 3 super()
.
...
PiperOrigin-RevId: 424916118
2022-01-28 11:26:34 -08:00
Michael Reneer
9050f18b59
Update TensorFlow Privacy to use Python 3 metaclass
.
...
PiperOrigin-RevId: 424773127
2022-01-27 20:32:04 -08:00
Michael Reneer
b0803999ad
Add license and missing build targets to __init__.py
files in TensorFlow Privacy.
...
* Added license.
* Removed `.../membership_inference_attack/codelabs/__init__.py`, this code does not look like it needs to be part of the Python package.
* Removed `.../research/pate_2017/__init__.py`, this code does not look like it needs to be part of the Python package.
PiperOrigin-RevId: 424682641
2022-01-27 12:40:23 -08:00
Michael Reneer
c36ce6d799
Normalize mpmath
imports in TensorFlow Privacy to be more friendly with strict dependencies and lint.
...
PiperOrigin-RevId: 424681602
2022-01-27 12:35:43 -08:00
Michael Reneer
81a11eb824
Remove the mock
dependency from TensorFlow Privacy, this is now part of the Python standard library.
...
PiperOrigin-RevId: 424681527
2022-01-27 12:34:59 -08:00
Michael Reneer
a749ce4e30
Remove TensorFlow Privacy __future__
imports.
...
Note: Exclude changes to the research directory.
PiperOrigin-RevId: 424650953
2022-01-27 10:37:22 -08:00
Michael Reneer
cfb1b881d8
Normalize scipy
imports in TensorFlow Privacy to be more friendly with strict dependencies and lint.
...
PiperOrigin-RevId: 424649853
2022-01-27 10:33:23 -08:00
Michael Reneer
47b439e376
Remove TensorFlow Privacy dependency on six
.
...
Python 2 is not supported, please use Python 3.
PiperOrigin-RevId: 424435761
2022-01-26 13:56:30 -08:00
Michael Reneer
1424cb2418
Rename TensorFlow Privacy Python tests to have the name foo_test
.
...
* Renamed Python test.
* Fixed usage of deprecated `assertRaisesRegexp`.
Python tooling pattern matches on file name, so it is important for tests to end with the suffix "_test" in order to interact with such tooling well.
In this case, these test are getting lint errors they should not and not getting lint errors they should.
PiperOrigin-RevId: 424433864
2022-01-26 13:48:31 -08:00
Michael Reneer
28dbbbb9e5
Remove TensorFlow Privacy Python lint as
directive.
...
This is now the default behavior.
PiperOrigin-RevId: 424403961
2022-01-26 11:47:14 -08:00
Michael Reneer
b309916927
Fix TensorFlow Privacy g-importing-member
lint error.
...
PiperOrigin-RevId: 424356142
2022-01-26 08:40:57 -08:00
Michael Reneer
4b76e882bc
Fix lint errors in dp_optimizer_test
.
...
PiperOrigin-RevId: 424183036
2022-01-25 14:36:57 -08:00
Shuang Song
3a4c4400a6
For MIA in seq2seq model, add support for graph mode, add data information and fix small typo in seq2seq_membership_inference_codelab.ipynb.
...
PiperOrigin-RevId: 422909904
2022-01-19 14:50:48 -08:00
David Marn
f47200f60d
Updates the path for seq2seq codelab colab button.
...
PiperOrigin-RevId: 421607919
2022-01-13 10:53:33 -08:00
Shuang Song
f301595ba5
Fix a bug in keras_evaluation and its example.
...
PiperOrigin-RevId: 420787967
2022-01-10 09:58:39 -08:00
Galen Andrew
867f3d4c55
Minor bug in tree aggregation accountant test.
...
PiperOrigin-RevId: 420145652
2022-01-06 14:32:52 -08:00
Galen Andrew
dd1e6f2d0c
Automated rollback of commit 668afa892e
...
PiperOrigin-RevId: 419910568
2022-01-05 14:13:54 -08:00
Galen Andrew
668afa892e
Migrate references to dp_event
to Google DP libraries.
...
PiperOrigin-RevId: 419663382
2022-01-04 13:11:10 -08:00
Shuang Song
8d147bc9d7
For MIA plotting, allow customized plotting function and set equal x and y aspects.
...
PiperOrigin-RevId: 417852309
2021-12-22 11:08:54 -08:00
Steve Chien
c6576f60c4
Ensure that apply_gradients in dp_optimizer.py is using intended arguments for calls to superclass.
...
PiperOrigin-RevId: 417654563
2021-12-21 11:06:10 -08:00
Steve Chien
347b99d412
Apply fix to apply_gradients method in vectorized DP Keras optimizer that affected gradient aggregation in multi-replica training.
...
PiperOrigin-RevId: 417506496
2021-12-20 17:10:39 -08:00
A. Unique TensorFlower
31f110698d
Fix of the apply_gradients in Keras DP optimizer.
...
PiperOrigin-RevId: 417503887
2021-12-20 16:52:50 -08:00
David Marn
03014d0e99
Adds an init file to secret sharer.
...
PiperOrigin-RevId: 416819054
2021-12-16 08:38:46 -08:00
Zheng Xu
38eface1fd
zCDP for tree aggregation.
...
PiperOrigin-RevId: 416338656
2021-12-14 10:33:04 -08:00
Zheng Xu
8850c23f67
Move tree_aggregation accountant to their own module.
...
PiperOrigin-RevId: 414770173
2021-12-07 10:48:55 -08:00
Zheng Xu
245fd069ca
RDP accounting for tree aggregation without restart. This implements the dynamic programming algorithm detailed in the updated version of "Practical and Private (Deep) Learning without Sampling or Shuffling"
...
https://arxiv.org/abs/2103.00039 .
PiperOrigin-RevId: 414583453
2021-12-06 17:38:48 -08:00
A. Unique TensorFlower
49db04e356
Overwrite the get_config method for dp_optimizer to reflect the actual parameters required(noise_multiplier, l2_norm_clip)
...
PiperOrigin-RevId: 413520270
2021-12-01 15:06:31 -08:00
Wennan Zhu
290ecf7797
Create a hierarchical histogram IterativeProcess that is compatible with tff.backends.mapreduce.MapReduceForm.
...
PiperOrigin-RevId: 411845363
2021-11-23 10:38:16 -08:00
David Marn
7c4f5bab09
Allows one to run a test on probabilities alone.
...
PiperOrigin-RevId: 409095932
2021-11-11 02:17:00 -08:00
Zheng Xu
9757e1bc87
Update the tree aggregation RDP accounting for restarts. This prevents the potential inaccurate usage of the previous implementation for no-restarts.
...
PiperOrigin-RevId: 406878834
2021-11-01 11:39:49 -07:00
A. Unique TensorFlower
c5cb687507
Allow using gradient tape for gradient calculation in graph mode.
...
PiperOrigin-RevId: 406217961
2021-10-28 14:26:33 -07:00
Steve Chien
c530356ae9
Add tests for varying number of microbatches in dp_optimizer_test.py.
...
PiperOrigin-RevId: 404072714
2021-10-18 15:09:07 -07:00
Galen Andrew
977647a3bf
Add support for subsampled multi-Gaussian queries (composition of several Gaussian queries that may have different noise multipliers). This is used, for example, by QuantileAdaptiveClipSumQuery.
...
PiperOrigin-RevId: 402693872
2021-10-12 17:13:25 -07:00
Zheng Xu
98df2fed61
Fix a typo in test comment.
...
PiperOrigin-RevId: 402327052
2021-10-11 10:04:00 -07:00
Zheng Xu
27bb6e48d9
Time based indicator for restart query.
...
PiperOrigin-RevId: 401871582
2021-10-08 15:40:57 -07:00
Zheng Xu
7426a4ec30
Update tree aggregation rdp accountant to allow different number of max_participation.
...
PiperOrigin-RevId: 399510813
2021-09-28 13:04:21 -07:00
Zheng Xu
99c82a49d8
Function to reset tree for tree aggregation based quantile estimation.
...
PiperOrigin-RevId: 399508765
2021-09-28 12:55:52 -07:00
Galen Andrew
b8b4c4b264
Much more detailed documentation for DpEvent
.
...
The as yet unused `TreeAggregationDpEvent` is removed. It will be added as a custom `DpEvent` alongside the DpQueries in tree_aggregation_query.py in the near future.
PiperOrigin-RevId: 398808647
2021-09-24 13:59:42 -07:00
Galen Andrew
39c75f62af
DpEventBuilder tracks the order of events, instead of just maintaining a multiset.
...
Existing approaches to accounting are generally agnostic to the order of composition, even when the composition is adaptive. But in principle it is possible for an accountant to require such information, so we had better not throw it away.
Note that `ComposedDpEvent` is now treated like any other `DpEvent`, not taken apart and the components added separately as it was. The reason for this is that a common pattern may be to compose a series of `ComposedDpEvent`s that have identical substructure. We want the `DpEventBuilder` to represent this as a single `SelfComposedDpEvent`, not a linearly-growing `ComposedDpEvent`.
PiperOrigin-RevId: 398359519
2021-09-22 16:37:46 -07:00
Galen Andrew
67a7096d52
ComposedDpEvent can be a list of any DpEvent, not only SelfComposedDpEvent. For example there is no reason we shouldn't be able to compose a single GaussianDpEvent and a single LaplaceDpEvent without having to wrap them in SelfComposedDpEvent with count == 1.
...
PiperOrigin-RevId: 398288473
2021-09-22 11:31:01 -07:00
Zheng Xu
c39d628e16
Change PeriodicRoundRestartIndicator
to return the first True
at a given number of calls. Also update the code style to be more compatible with graph mode and TFF.
...
PiperOrigin-RevId: 397918733
2021-09-20 22:38:48 -07:00
Galen Andrew
388f46ffa0
Adds RdpAccountant: implementation of PrivacyAccountant for RDP. Also adds UnsupportedEventError for handling unsupported events by PrivacyAccountant.
...
PiperOrigin-RevId: 397878895
2021-09-20 17:19:51 -07:00
Zheng Xu
b572707cfc
Update reset and pre-process functions for tree aggregation queries. Minor comments update for adaptive clip query tests.
...
PiperOrigin-RevId: 396483111
2021-09-13 17:48:11 -07:00
A. Unique TensorFlower
7f22cbeb89
Add support of large batch emulation to Tensorflow Privacy Keras optimizer.
...
PiperOrigin-RevId: 395802081
2021-09-09 15:37:54 -07:00
Zheng Xu
a9764e3e7d
TFF: cleanup the TFP query usage in tff.analytics; remove dependency on internal TFP structure.
...
TFP: remove duplicate TreeRangeSumQuery in `tree_aggregation_query`
PiperOrigin-RevId: 395618363
2021-09-08 21:05:53 -07:00
Zheng Xu
c5f35b3ca1
Try to fix flakiness by reducing the number of query construction.
...
PiperOrigin-RevId: 395552656
2021-09-08 13:59:15 -07:00
Galen Andrew
06eef51369
New version 0.7.3
...
PiperOrigin-RevId: 395263672
2021-09-07 09:24:02 -07:00
Zheng Xu
a20cbf9578
RDP for tree aggregation. See "Practical and Private (Deep) Learning without Sampling or Shuffling" https://arxiv.org/abs/2103.00039 for more details. See tests for example usage for calculating epsilon.
...
PiperOrigin-RevId: 394770205
2021-09-03 15:42:46 -07:00
Zheng Xu
e99fb7ea9b
Try to fix flaky tree_aggregation_query_test.test_noisy_cumsum_and_state_update
.
...
PiperOrigin-RevId: 394248815
2021-09-01 09:30:01 -07:00
Galen Andrew
7e7736ea91
Add DpEvent to return value of get_noised_result. For most DPQueries, the default UnsupportedDpEvent is returned, pending further development.
...
PiperOrigin-RevId: 394137614
2021-08-31 19:28:13 -07:00
Zheng Xu
6ac4bc8d01
Define RestartQuery
for easy composition to restart tree in tree aggregation queries.
...
PiperOrigin-RevId: 394106175
2021-08-31 16:07:26 -07:00
Galen Andrew
789a05df63
Add DpEvent to TFP public symbols.
...
PiperOrigin-RevId: 394010603
2021-08-31 08:41:56 -07:00
Steve Chien
3059fbae67
Fix heterogeneous spellings of "heterogeneous".
...
PiperOrigin-RevId: 393881235
2021-08-30 16:46:05 -07:00
Mark Daoust
54f1887b10
Use from tensorflow_privacy import v1
so v1 is visible to the api-generator.
...
PiperOrigin-RevId: 393866702
2021-08-30 15:28:15 -07:00
Zheng Xu
5edea5863c
Add STDDEV to the state of random noise generator, which will be used to enable adaptive clipping norm in tree aggregation queries.
...
PiperOrigin-RevId: 393851743
2021-08-30 14:17:28 -07:00
Galen Andrew
07c248d868
Adds NeighboringRelation to Accountant and clarifies FixedBatchSample events to be with or without replacement.
...
PiperOrigin-RevId: 393459878
2021-08-27 17:33:40 -07:00
Galen Andrew
48e4836a36
Remove deleted compute_rdp_from_ledger from public symbols.
...
PiperOrigin-RevId: 393161824
2021-08-26 10:58:52 -07:00
Galen Andrew
d9236d5619
Remove PrivacyLedger which will soon be replaced by DpEvent and PrivacyAccountant.
...
PiperOrigin-RevId: 393147667
2021-08-26 10:00:15 -07:00
Galen Andrew
0e04e1baeb
Adding NonPrivateDpEvent and UnsupportedDpEvent.
...
PiperOrigin-RevId: 393028308
2021-08-25 19:07:18 -07:00
Galen Andrew
9b48c81b6a
Minor cleanup.
...
PiperOrigin-RevId: 392982022
2021-08-25 14:35:39 -07:00
Galen Andrew
433b66b316
New DpEvent/PrivacyAccountant libraries.
...
PiperOrigin-RevId: 392977699
2021-08-25 14:16:41 -07:00
Zheng Xu
853b18929d
Move TreeRangeSumQuery
to its own module. This is the first step, will remove the function in the old module after a TFP release.
...
PiperOrigin-RevId: 392776774
2021-08-24 16:51:55 -07:00
Galen Andrew
477b5b2899
Remove declaration of dependency on tensorflow.
...
PiperOrigin-RevId: 392683668
2021-08-24 09:39:25 -07:00
Wennan Zhu
b9e4cf1a20
Automated rollback of commit 0600fa26a2
...
PiperOrigin-RevId: 392126244
2021-08-20 21:35:49 -07:00
Zheng Xu
ef83391ce6
Use tree aggregation noise for quantile estimation.
...
PiperOrigin-RevId: 391928297
2021-08-19 23:56:41 -07:00
Michael Reneer
0600fa26a2
Automated rollback of commit d9a7596815
...
PiperOrigin-RevId: 391885401
2021-08-19 17:57:10 -07:00
A. Unique TensorFlower
d9a7596815
Remove deprecated CentralTreeSumQuery
and DistributedTreeSumQuery
. They are replaced by TreeRangeSumQuery
...
PiperOrigin-RevId: 390449215
2021-08-12 13:39:00 -07:00
Zheng Xu
50673fec40
Minor fix for the nondeterministic seed of tree_aggregation.GaussianNoiseGenerator. The previous log results won't change much, while one seed is probably good enough.
...
PiperOrigin-RevId: 390412713
2021-08-12 11:03:14 -07:00
Zheng Xu
b8c1ba72cd
Change default restarter state in tree_aggregation_query to empty tuple as None type is not compatible with TFF.
...
PiperOrigin-RevId: 390278173
2021-08-11 20:20:49 -07:00
Zheng Xu
b4c04093cf
Restart the tree state in tree related DPQuery for streaming data: a general abstract class and an instance of restarting every a few rounds.
...
PiperOrigin-RevId: 390244330
2021-08-11 16:29:18 -07:00
Galen Andrew
f44dcb8760
Add tensorflow and tensorflow-datasets to setup/requirements.
...
PiperOrigin-RevId: 390171562
2021-08-11 10:54:46 -07:00
Galen Andrew
c447a1a3c2
Bump version number.
...
PiperOrigin-RevId: 389959093
2021-08-10 13:08:24 -07:00
Ken Liu
f3af24b00e
Adds central discrete Gaussian DPQuery.
...
PiperOrigin-RevId: 389467360
2021-08-08 03:43:23 -07:00
A. Unique TensorFlower
aa3f841893
In TreeRangeSumQuery.preprocess_record
, move the reshaping operation before applying inner_query.preprocess_record
. The change is due to the newly checked-in DistributedDiscreteGaussianSumQuery
whose preprocess_record
requires explicit shape information during tracing.
...
PiperOrigin-RevId: 389392878
2021-08-07 11:21:32 -07:00
A. Unique TensorFlower
11900acf9b
Fixed the previous bug that get_noised_result
does not map inner_query's get_noised_result
to the input record and updates global_state
.
...
PiperOrigin-RevId: 388153296
2021-08-01 23:13:20 -07:00
A. Unique TensorFlower
2672559471
(1) Merge CentralTreeSumQuery
and DistributedTreeSumQuery
into one DPQuery to modularize things. The new query takes in an inner_query
argument. Depending on the behavior of inner query, the query will follow central DP or distributed DP.
...
(2) Remove the hard-coded L1 clipping and replace with norm bound checking in the inner query. This design allows us to use whatever clipping factory we want outside the DPQuery.
PiperOrigin-RevId: 387398741
2021-07-28 11:40:15 -07:00
Keith Rush
eef5810d94
Automated rollback of commit 4d335d1b69
...
PiperOrigin-RevId: 387254617
2021-07-27 20:04:28 -07:00
A. Unique TensorFlower
4d335d1b69
(1) Merge CentralTreeSumQuery
and DistributedTreeSumQuery
into one DPQuery to modularize things. The new query takes in an inner_query
argument. Depending on the behavior of inner query, the query will follow central DP or distributed DP.
...
(2) Remove the hard-coded L1 clipping and replace with norm bound checking in the inner query. This design allows us to use whatever clipping factory we want outside the DPQuery.
PiperOrigin-RevId: 387236482
2021-07-27 17:42:37 -07:00
Ken Liu
e7e11d14d9
Adds discrete Gaussian (sampler and distributed DPQuery) to public TF Privacy.
...
PiperOrigin-RevId: 387232449
2021-07-27 17:18:16 -07:00
Steve Chien
2f862eba9b
Move TensorFlow v1 imports to their own __init__.py file in a new subdirectory.
...
PiperOrigin-RevId: 387156295
2021-07-27 11:28:42 -07:00
A. Unique TensorFlower
2cafe28d8d
The previous version uses tf.nest.map_structure
to apply add_noise
to a tf.RaggedTensor
. This causes a bug when used in tensorflow federated because tf.nest.map_structure
will also map add_noise
to the tensor for shape information in tf.RaggedTensor
. This causes failure when tff conducts automatic type conversion.
...
Also use fixed random seed to avoid flaky timeouts and testing failures.
PiperOrigin-RevId: 384573740
2021-07-13 16:14:15 -07:00
Galen Andrew
7f44b02456
Increment version number.
...
PiperOrigin-RevId: 384507585
2021-07-13 11:14:18 -07:00
A. Unique TensorFlower
caf6f36b80
(1) add CentralTreeSumQuery
and DistributedTreeSumQuery
to tree_aggregation_query.py. (2) move build_tree_from_leaf
to tree_aggregation_query.py together with CentralTreeSumQuery
.
...
PiperOrigin-RevId: 383511025
2021-07-07 15:55:22 -07:00
Kuangyuan Chen
d6aa796684
Automated rollback of commit 4326014a0e
...
PiperOrigin-RevId: 383505647
2021-07-07 15:26:23 -07:00
Steve Chien
4326014a0e
Move TensorFlow v1 imports to their own __init__.py file in a new subdirectory.
...
PiperOrigin-RevId: 383485268
2021-07-07 13:45:38 -07:00
Steve Chien
beed219d20
Update docstring for DPModel class.
...
PiperOrigin-RevId: 382855055
2021-07-02 20:04:25 -07:00
Steve Chien
45c935832a
Update docstrings for all DP optimizer classes.
...
PiperOrigin-RevId: 382811363
2021-07-02 14:18:44 -07:00
Zheng Xu
c192a4166b
Add a TODO comment for replacing noise saving with seed saving for tree aggregation.
...
PiperOrigin-RevId: 382338346
2021-06-30 10:46:13 -07:00
Shuang Song
3055f4ad52
Add header and some minor comments to secret sharer colab.
...
PiperOrigin-RevId: 382225535
2021-06-29 21:26:29 -07:00
A. Unique TensorFlower
2396098b94
Add build_tree
function which takes in a histogram and builds a tree on top of it. The function will be used in CentralTreeSumQuery
and DistributedTreeSumQuery
in a following CL.
...
For more details about `CentralTreeSumQuery` and `DistributedTreeSumQuery`, please refer to the implementation design section in the following design doc: https://docs.google.com/document/d/14LL94yZx3MdorCEOE0QZNhyIx7P_3voyrl4Nlt2HF7k/edit?resourcekey=0-X3xeTk6w-fkYFezl5fxmCQ#
PiperOrigin-RevId: 382199971
2021-06-29 17:31:21 -07:00
Steve Chien
34249f464b
Update version to 0.6.1 to prepare for new release.
...
PiperOrigin-RevId: 382196622
2021-06-29 17:08:44 -07:00
Shuang Song
b92aeaedee
Add init file for privacy_tests.
...
PiperOrigin-RevId: 382195968
2021-06-29 17:04:54 -07:00
Shuang Song
0caa10f674
Internal change.
...
PiperOrigin-RevId: 382171367
2021-06-29 14:54:27 -07:00