Skip to content
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

Patch ctgan batchsize1 #263

Merged
merged 11 commits into from
Apr 12, 2024
2 changes: 1 addition & 1 deletion src/synthcity/plugins/core/models/gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def _loss_gradient_penalty(
interpolated = (
alpha * real_samples + ((1 - alpha) * fake_samples)
).requires_grad_(True)
d_interpolated = self.discriminator(interpolated).squeeze()
d_interpolated = self.discriminator(interpolated).squeeze(-1)
labels = torch.ones((len(interpolated),), device=self.device)

# Get gradient w.r.t. interpolates
Expand Down
Loading