tensorflow / tensorflow/privacy

DPKeras<name>Optimizer fail when Sequential model has layer with kernel_regularizer=tf.keras.regularizers.l2(l2_ratio)

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
477
Avg merge
22h 12m
Merged PRs (30d)
1

Description

Hi,

I encountered a problem when adding regularization to Keras models using the new DPKerasOptimizer's with TF2.4.0 with (Sparse)CategoricalCrossentropy. The error (see below) can be reproduced by adding kernel_regularizer=tf.keras.regularizers.l2(1e-8)to a layer in mnist_dpsgd_tutorial_keras.py.

sysout.txt

macos 10.15
python 3.7

Thanks in advance,
Craig

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in mnist_dpsgd_tutorial_keras.py by adding kernel_regularizer=tf.keras.regularizers.l2(1e-8) to a layer and using the DPKerasOptimizer with TF2.4.0 and SparseCategoricalCrossentropy. Review the attached sysout.txt alongside the tutorial behavior; done means the tutorial runs successfully with the regularized layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.