Commit graph

840 commits

Author SHA1 Message Date
Michael Reneer
a9ea9ba4a0 Remove unneeded tensorflow-privacy dependencies.
Please note:
1. I have manually tested the TFP release for python 3.10.
2. TFP does not define the set of python version that it is compatible with.

This change should be followed up with the following changes:
* Define the set of python version that TFP is compatible with.
* Setup a Python package building test.
* Release TFP so that projects depending on TFP can support Python 3.11

PiperOrigin-RevId: 572297305
2023-10-10 10:34:54 -07:00
Michael Reneer
0eea97f220 Update to the latest version of tensorflow-probablity.
PiperOrigin-RevId: 572283525
2023-10-10 09:59:01 -07:00
Michael Reneer
43bfbc0af1 Cleanup and add build, test, and publish scripts for the TFP Python package.
PiperOrigin-RevId: 571419982
2023-10-06 13:26:05 -07:00
Steve Chien
0d1bd9db3e Add __init.py__ to registry_functions.py
PiperOrigin-RevId: 570724438
2023-10-04 09:53:39 -07:00
A. Unique TensorFlower
62a2d43d1c Add the second set of EinsumDense utility functions for implementing fast gradient norm computation.
PiperOrigin-RevId: 568063831
2023-09-24 16:16:40 -07:00
Galen Andrew
1be6e026e7 Bump version for github/pypi release with new attrs dependency.
PiperOrigin-RevId: 567696437
2023-09-22 13:00:14 -07:00
A. Unique TensorFlower
c037070e50 Improve the readability of the fast gradient clipping library.
PiperOrigin-RevId: 566961891
2023-09-20 07:47:43 -07:00
Michael Reneer
97aaf302eb Update the version of some dependencies in tensorflow_privacy.
* `attrs` to `>=21.4`.
* `dp-accounting` to `>=0.4.3`.

PiperOrigin-RevId: 566758983
2023-09-19 15:22:40 -07:00
A. Unique TensorFlower
e20c92243a Implement and test a registry function for tfm.nlp.layers.PositionEmbedding.
PiperOrigin-RevId: 565450719
2023-09-14 12:55:09 -07:00
A. Unique TensorFlower
c7db4fa8cb Add support for microbatching in the tf.keras.layers.LayerNormalization fast square norm function.
PiperOrigin-RevId: 565050132
2023-09-13 07:56:42 -07:00
A. Unique TensorFlower
bcc0d4927e Implement and test a registry function for tfm.nlp.layers.OnDeviceEmbedding.
This CL also moves the common embedding `sqr_norm_fn` logic between
`tf.keras.layers.Embedding` and `tfm.nlp.layers.OnDeviceEmbedding` into a
new registry function utility file.

PiperOrigin-RevId: 564481407
2023-09-11 13:18:08 -07:00
A. Unique TensorFlower
113b27be43 Add the first set of EinsumDense utility functions for implementing fast gradient norm computation.
PiperOrigin-RevId: 564460945
2023-09-11 12:06:12 -07:00
A. Unique TensorFlower
a23cccde8b Ensures types remain consistent.
PiperOrigin-RevId: 563244784
2023-09-06 16:13:14 -07:00
A. Unique TensorFlower
c92610e37a Implement and test a registry function for tf.keras.layers.LayerNormalization.
PiperOrigin-RevId: 561423397
2023-08-30 12:54:08 -07:00
Steve Chien
372c934d14 Fix bug in v1 estimators that was preventing use of microbatches.
PiperOrigin-RevId: 560765153
2023-08-28 11:14:38 -07:00
A. Unique TensorFlower
b4b47b1403 Generalize the testing API to support input Tensors of dimension >1,
excluding the batch dimension.

This is a forward-looking change for testing more general layers such as
`tf.keras.layers.LayerNormalization` and `tf.keras.layers.EinsumDense`.

PiperOrigin-RevId: 560709678
2023-08-28 07:50:52 -07:00
Richard Levasseur
6248be8290 Internal Code Change
PiperOrigin-RevId: 557198768
2023-08-15 11:42:02 -07:00
Shuang Song
27069d347d Fixes comments and membership scores for thresholds attack.
PiperOrigin-RevId: 555579896
2023-08-10 11:31:29 -07:00
Shuang Song
fafa69b65c
Merge pull request #484 from ethz-spylab/master
Fix training mode for LiRA code at inference
2023-08-03 22:10:59 -07:00
Steve Chien
a32e6ae5d0 Add DP versions of v1 FTRL optimizer.
PiperOrigin-RevId: 553186886
2023-08-02 10:30:35 -07:00
Galen Andrew
b7e9709ff7 Remove workspace dependency on specific github release of dp_accounting.
PiperOrigin-RevId: 551651015
2023-07-27 15:04:19 -07:00
Galen Andrew
67c9c2424c Internal change.
PiperOrigin-RevId: 551648705
2023-07-27 14:55:51 -07:00
Steve Chien
134c898ded Add DP-SGD version of v1 LinearClassifier.
PiperOrigin-RevId: 551350685
2023-07-26 16:38:41 -07:00
Shuang Song
225355258c Calls epsilon computation in MIA.
PiperOrigin-RevId: 551003589
2023-07-25 14:50:13 -07:00
Steve Chien
8e60864559 Minor code cleanup to compute_dp_sgd_privacy_lib and update dp_accounting dependency.
PiperOrigin-RevId: 550695787
2023-07-24 15:48:45 -07:00
A. Unique TensorFlower
c1c97f1c1c Modify fast clipping logic to support computation on TPUs.
PiperOrigin-RevId: 550673798
2023-07-24 14:28:45 -07:00
A. Unique TensorFlower
cb6659d11b COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/privacy/pull/489 from mhaghifam:dp-second-order-optimization 024904810a8f130d554cc3f04713d5562ccfe5df
PiperOrigin-RevId: 547312570
2023-07-11 16:02:29 -07:00
A. Unique TensorFlower
6b8007ddde Re-organize files and simplify test names.
These changes are intended to support a more modular system for when we
add more layer registry functions (and their corresponding tests). They are
also made so that we do not have an enormous number of lengthy tests inside
`clip_grads_test.py`.

PiperOrigin-RevId: 545779495
2023-07-05 14:01:09 -07:00
A. Unique TensorFlower
9536fb26e7 Update LICENSE rules for TF Privacy to the new API.
PiperOrigin-RevId: 545774183
2023-07-05 13:42:20 -07:00
Vadym Doroshenko
a147a480a5 Finish implementation of custom indices names.
PiperOrigin-RevId: 545440374
2023-07-04 07:19:18 -07:00
Vadym Doroshenko
93f5a5249c Add slice names for custom slices
PiperOrigin-RevId: 544599507
2023-06-30 02:33:03 -07:00
Galen Andrew
f953e834df New version updates dependendices.
PiperOrigin-RevId: 544133468
2023-06-28 12:46:28 -07:00
Michael Reneer
5b21aad36e Update the scipy dependency to 1.9.
PiperOrigin-RevId: 543452894
2023-06-26 08:59:44 -07:00
Vadym Doroshenko
45da453410 Implement possibility to return slice indices.
PiperOrigin-RevId: 540885025
2023-06-16 08:22:43 -07:00
Edoardo Debenedetti
6301f3ffef
Merge branch 'tensorflow:master' into master 2023-06-13 15:09:21 +02:00
Edoardo Debenedetti
ab4cb09399 Fix LiRA inference 2023-06-13 09:57:46 +02:00
Zheng Xu
a4bdb05b62 zCDP to epsilon for tree aggregation accounting.
PiperOrigin-RevId: 539706770
2023-06-12 11:09:14 -07:00
Walid Krichene
18c43b351b Support weighted losses in DPModel.
PiperOrigin-RevId: 538011437
2023-06-05 16:27:19 -07:00
Steve Chien
60d237be83 Update tensorflow-probability version to 0.20.0
PiperOrigin-RevId: 533550592
2023-05-19 14:22:24 -07:00
A. Unique TensorFlower
0f5acf868e Add additional tests and checks on the passed loss function.
PiperOrigin-RevId: 532225904
2023-05-15 14:27:46 -07:00
Shuang Song
8fdac5f833 Test DPModel in distributed training.
PiperOrigin-RevId: 528039164
2023-04-28 18:57:29 -07:00
Walid Krichene
e65e14b2d6 Fix bug in DPModel that shows up in distributed training.
PiperOrigin-RevId: 528026372
2023-04-28 17:31:18 -07:00
Galen Andrew
9710a4acc7 Bump version and update dependenciesfor pypi release.
PiperOrigin-RevId: 527377853
2023-04-26 14:35:24 -07:00
A. Unique TensorFlower
33bbc87ff2 Use better group privacy bound in computing user level privacy [TF Privacy]
PiperOrigin-RevId: 526852999
2023-04-24 22:17:24 -07:00
Michael Reneer
60cb0dd2fb Update tensorflow privacy to use NamedTuple instead of attrs.
This allows these objects to be traversed when nested in tree-like structures more easily.

PiperOrigin-RevId: 525532511
2023-04-19 13:18:25 -07:00
Shuang Song
e362f51773 Supports slicing for multi-label data.
PiperOrigin-RevId: 523846333
2023-04-12 17:14:11 -07:00
Galen Andrew
d5e41e20ad More detailed description of arguments in compute_dp_sgd_privacy.
PiperOrigin-RevId: 522693217
2023-04-07 15:07:35 -07:00
Shuang Song
c4628d5dbc Skips adding noise when noise_multiplier is 0 for fast clipping.
PiperOrigin-RevId: 522396275
2023-04-06 11:54:55 -07:00
Shuang Song
de9836883d Skips noise addition when noise_multiplier is 0. Fix a typo.
PiperOrigin-RevId: 521912964
2023-04-04 17:48:24 -07:00
A. Unique TensorFlower
ee1abe6930 Generalize generate_model_outputs_using_core_keras_layers().
This change adds the following two new features to the above function:
(i) it supports nested custom layers of depth >2;
(ii) it allows the caller to exclude certain layers from the expansion.

Feature (ii) will be needed for the development of DP models that use
Trasformer or BERT-type layers.

PiperOrigin-RevId: 520919934
2023-03-31 07:41:16 -07:00