Commit graph

863 commits

Author SHA1 Message Date
Steve Chien
0582cfdd1a Set TensorFlow version to at most 2.15.0 to avoid problems with using Keras 3.
PiperOrigin-RevId: 625104162
2024-04-15 15:34:17 -07:00
Steve Chien
e28c673b74 Update README.md to reflect the split in PyPI packages.
PiperOrigin-RevId: 607516568
2024-02-15 18:06:53 -08:00
Steve Chien
1b1c0b65d9 In setup_empirical.py, increase version of required tensorflow-privacy package to 0.9.0.
PiperOrigin-RevId: 607060540
2024-02-14 11:57:23 -08:00
Steve Chien
e3b4662d3e Fix small error in setup_empirical.py.
PiperOrigin-RevId: 606290383
2024-02-12 10:20:46 -08:00
Steve Chien
d1290796b3 Increase version to 0.9.0 after splitting off TF empirical privacy package.
PiperOrigin-RevId: 605392906
2024-02-08 12:22:59 -08:00
Steve Chien
308cbda4db Remove scripts from deprecated directory.
PiperOrigin-RevId: 605370687
2024-02-08 11:07:11 -08:00
Steve Chien
95b87270d9 Split TensorFlow Privacy pypi package into two parts-- one for DP training, and one for privacy tests.
PiperOrigin-RevId: 605137291
2024-02-07 16:48:44 -08:00
Steve Chien
bbb1b487c1 Fix statsmodels version to 0.14.0, since 0.14.1 causes a breakage.
PiperOrigin-RevId: 591040422
2023-12-14 13:45:38 -08:00
Fiona Lang
5e8a2688ee Fix packaging import.
PiperOrigin-RevId: 591002147
2023-12-14 11:27:17 -08:00
Zheng Xu
a4deb12ee0 Add a metric for TA-DP-FTRL,
PiperOrigin-RevId: 590791663
2023-12-13 20:03:31 -08:00
Steve Chien
81a4fd82f7 Temporarily disable two unit tests while fixing a problem with multiprocessor setup.
PiperOrigin-RevId: 590782049
2023-12-13 19:05:10 -08:00
William Kong
fbe5879023 Add utility functions for unwrapping BERT encoder layers into individual Keras layers.
PiperOrigin-RevId: 588419989
2023-12-06 07:29:57 -08:00
Pritish Kamath
93376c9d6a Add support for PLD Accountant in computing DP-SGD privacy statement [TF Privacy]
PiperOrigin-RevId: 587854134
2023-12-04 15:08:58 -08:00
William Kong
f51b637dda Add support for fast clipping of dense layer gradients where the dimension of the input is larger than 1.
This change specifically wraps the fast clipping logic used in EinsumDense layers, which is a generalization of the Gramian-based that was used for dense layer clipping.

PiperOrigin-RevId: 585809850
2023-11-27 17:58:39 -08:00
William Kong
b19088f048 Implement and test a registry function for tf.keras.layers.MultiHeadAttention.
PiperOrigin-RevId: 584620638
2023-11-22 07:17:47 -08:00
William Kong
03db50ba94 Add a parameter to the noise function that explicitly specifies the loss reduction type.
PiperOrigin-RevId: 583507445
2023-11-17 15:54:59 -08:00
William Kong
39c8a8c1af Implement and test a registry function for tfm.nlp.layers.EinsumDense + small formatting fixes.
PiperOrigin-RevId: 576215816
2023-10-24 11:54:45 -07:00
Michael Reneer
8b52ba246c Update the Python package scripts to use Python 3.11 explicitly.
PiperOrigin-RevId: 572426991
2023-10-10 18:43:52 -07:00
Michael Reneer
e1eef3c251 Add a description to the TFP Python package.
PiperOrigin-RevId: 572384355
2023-10-10 15:30:58 -07:00
Michael Reneer
1ecf9e18cc Update the documentation in the TFP requirements.txt.
PiperOrigin-RevId: 572353174
2023-10-10 13:40:55 -07:00
Michael Reneer
fd7cc7607f Update the Python package scripts to use Python 3.10 explicitly.
Failure:

1. From the build scripts:

```
+ ./tools/build_pip_package.sh
Python 3.8.10
```

2. But `tensorflow-probability` does not support Python 3.8, https://pypi.org/project/tensorflow-probability/

The fix is to update TFP build scripts to use Python 3.10 explicitly because it appears there are unsupported version of Python on the build machines.

PiperOrigin-RevId: 572339377
2023-10-10 12:50:56 -07:00
Michael Reneer
96b099f5c7 Bump version for github/pypi release with new tensorflow-probability dependency.
PiperOrigin-RevId: 572323479
2023-10-10 11:53:17 -07:00
Michael Reneer
5821848fdc Update TFP setup.py to document the required versions of Python.
PiperOrigin-RevId: 572308763
2023-10-10 11:05:59 -07:00
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