Skip to content

Backprop minus real error for DP-GAN #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JimAchterbergLUMC opened this issue Mar 30, 2025 · 0 comments
Open

Backprop minus real error for DP-GAN #330

JimAchterbergLUMC opened this issue Mar 30, 2025 · 0 comments

Comments

@JimAchterbergLUMC
Copy link

Description

The discriminator loss in a GAN consists of -err_real+err_fake.
When differential privacy is enabled, we can separately backpropagate the fake error (with hooks disabled) and real error (with hooks enabled).

However, the current code backpropagates err_fake and err_real, but I believe this should be err_fake and -err_real, to match the non-differentially private loss?

i.e., we should backpropagate "minus the real error" instead of simply the "real error", when differential privacy is enabled for GANs.

How to Reproduce

  1. Go to 'synthcity/plugins/core/models/gan.py', line 452. Here we see that the positive real error is backpropagated. However, looking at line 438, I believe this should be -(err_real).

Expected Behavior

Change line 452 in 'synthcity/plugins/core/models/gan.py' from errD_real.backward(), to (-errD_real).backward().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant