eriklindernoren / Keras-GAN

Keras implementations of Generative Adversarial Networks.
MIT License
9.18k stars 3.14k forks source link

WGAN: Why 1-d_loss? #180

Open lennert130994 opened 5 years ago

lennert130994 commented 5 years ago

So i plotted the loss of the critic during training. It starts off negative and then converges to zero as the generated samples improve. The way i see it, this means the Wasserstein distance between the Real and generated samples is getting smaller. Now my question is, why is d_loss starting at a negative value? and why is the code printing d_loss as 1-d_loss?

In other words, can someone explain to me how -d_loss and the wasserstein estimate are related? Why are these two things the same?

evertonaleixo commented 5 years ago

I think it start from negative because the optmizer is trying to maximize the objective function.

lennert130994 commented 5 years ago

Thanks for your reply @evertonaleixo. The way i see it the objective function of the critic is to maximize the 'distance' between the training data and the generated data, while the generator is trying to do the opposite. Based on this, I would expect the loss to start at a high possitive value and converge towards zero as the generator starts generating better samples. What I do not understand is why we need to plot 1-d_loss to get the Wasserstein estimate and not simply d_loss (as its trying to maximize that). Perhaps i do not understand your answer fully, so maybe you can elaborate?

Lorenzo-Mazza commented 3 years ago

That's my question as well. Is there a reason? I have not found any reference to 1-D Loss anywhere else