From 59ce286b724ad7d39c8eafadc443bf57486ae154 Mon Sep 17 00:00:00 2001 From: Roulbac Date: Wed, 30 Jan 2019 11:30:14 -0500 Subject: [PATCH] Important node to gradient penalty for wgangp As recommended in https://arxiv.org/pdf/1704.00028.pdf, using WGAN-GP loss needs not to use a normalization layer. --- models/networks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/models/networks.py b/models/networks.py index c49b9b7bda0..fcc2b6bc567 100644 --- a/models/networks.py +++ b/models/networks.py @@ -281,6 +281,7 @@ def cal_gradient_penalty(netD, real_data, fake_data, device, type='mixed', const lambda_gp (float) -- weight for this loss Returns the gradient penalty loss + NOTE: Strongly advised not to use batch/instance norm with the Discriminator(or Critic) if using gradient penalty! """ if lambda_gp > 0.0: if type == 'real': # either use real images, fake images, or a linear interpolation of two.