Comments (5)
Can you describe your setup? OS, TF version, etc...
from privacy.
I've tried both tf 1.14.0 and 2.0.0-beta1, and on both MacOS High Sierra and colab notebook. Both gives same results. The remaining is as mnist_dpsgd_tutorial_keras.py does:
learning_rate = 0.15
noise_multiplier = 1.1 #Ratio of the standard deviation to the clipping norm
l2_norm_clip = 1.0 #Clipping norm
batch_size = 250
epochs = 60
microbatches = 250
train_data, train_labels, test_data, test_labels = load_mnist()
optimizer = DPGradientDescentGaussianOptimizer(
l2_norm_clip=l2_norm_clip,
noise_multiplier=noise_multiplier,
num_microbatches=microbatches,
learning_rate=learning_rate)
# Compute vector of per-example loss rather than its mean over a minibatch.
loss = tf.keras.losses.CategoricalCrossentropy(
from_logits=True, reduction=tf.losses.Reduction.NONE)
# Compile model with Keras
mnist_model.compile(optimizer=optimizer, loss=loss, metrics=['accuracy'])
# Train model with Keras
mnist_model.fit(train_data, train_labels,
epochs=epochs,
validation_data=(test_data, test_labels),
batch_size=batch_size)
eps = compute_epsilon(epochs * 60000 // batch_size)
print('For delta=1e-5, the current epsilon is: %.2f' % eps)
from privacy.
I just ran the tutorial on a TF14 fresh install and couldn't reproduce the bug. Did you make any modifications to the tutorial?
from privacy.
You're right. I retried and verified that it works well with TF14. I was experimenting with TF 2.0.0-beta1 and could run the code after changing the logging to abseil and switching out the tf.contrib dependencies. But this gives only about 10% accuracy.
So the issue is with using TF 2.0.0-beta1.
from privacy.
I'm closing for now since we are still building up support for TF2. If you have specific bugs you identify with TF2, feel free to open separate issues for them.
from privacy.
Related Issues (20)
- Upgrade pandas to 1.4 to fix pandas binary incompatibility with numpy
- Insecure Random Number Generator HOT 1
- Potential bug using kernel regularizer
- tensorflow privacy requires numpy ~= 1.21 which is not compatible with python 11
- ValueError: Dimension size must be evenly divisible by 1048576 but is 1 for '{{node Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32](Mean, Reshape/shape)' with input shapes: [?,1024,1024], [0].
- from tensorflow_privacy.privacy.analysis import privacy_ledger HOT 3
- How can we specify to install it on tensorflow-gpu==2.4.0
- A Question about Research mi_lira_2021: why set training=True at Inference
- Inconsistency in released Versions between GitHub and PyPI HOT 1
- Privacy?
- cannot import name 'dp_event' from 'tensorflow_privacy.privacy.analysis' HOT 2
- Python version restricted to >=3.9, inability to use official docker containers of tensorflow HOT 1
- AttributeError: module 'tensorflow_privacy.privacy.analysis.compute_dp_sgd_privacy' has no attribute 'compute_dp_sgd_privacy' HOT 2
- Why isn't SampledWithoutReplacementDpEvent used instead of PoissonSampledDpEvent for DP-SGD epsilon calculation? HOT 2
- Question about rdp_accountant.py HOT 1
- question about "tensorflow_privacy.privacy.dp_query.gaussian_query" HOT 2
- Privacy guarantees of of privacy amplification by iteration example
- Federated DPFTRL and Adaptive Clipping noise injection. HOT 1
- Fresh install doesn't work (incompatible versions of tensorflow and tensorflow_privacy)
- Incompatible with hub.KerasLayer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from privacy.