From 7b6d0e23dedd0792fd66562ae8307078df063f62 Mon Sep 17 00:00:00 2001 From: ackongsun Date: Wed, 5 Dec 2018 15:41:39 +0800 Subject: [PATCH] some change to the G_ --- WGAN.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WGAN.py b/WGAN.py index 08e1b0a..4f1add3 100644 --- a/WGAN.py +++ b/WGAN.py @@ -141,7 +141,9 @@ def train(self): D_real = self.D(x_) D_real_loss = -torch.mean(D_real) - G_ = self.G(z_) + with torch.no_grad(): + G_ = self.G(z_) + D_fake = self.D(G_) D_fake_loss = torch.mean(D_fake)