I am new to GANs, but I was able to train a DCGAN decently. I decided to try a WGAN (not the improved one). I seem to get outputs, but my loss doesn't seem to converge for the generator.

I am using the loss function

from keras import backend as K
def wasserstein_loss(y_true, y_pred):
    return K.mean(y_true * y_pred)

for both the critic and generator. I am labelling real images as -1 and fake ones as 1.

Here's my loss over time:
critic loss converging, generator diverging
Is the generator loss supposed to behave like that? Even though the discriminator loss seems to behave as expected, is a swing that large normal?


1 Answer 1


If anyone's wondering, yes it is right. The weight-clipping WGAN is very sensitive to changes in the weight-clipping hyperparameter, which is probably causing this. Upgrading to the gradient descent version fixed it. Loss should look like this btw

enter image description here

  • 1
    $\begingroup$ How did you fix it? I have the same problem. $\endgroup$ Nov 20, 2020 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.