The loss function of WGAN

Okay, why are we learning all this? We saw previously that there is a problem with JS divergence in the loss function, so we resorted to the Wasserstein distance. Now, our goal of the discriminator is no longer to say whether the image is from the real or fake distribution; instead, it tries to maximize the distance between real and generated sample. We train the discriminator to learn the Lipschitz continuous function for computing the Wasserstein distance between a real and fake data distribution.

So, the discriminator loss is given as follows:

Now we need to ensure that our function is a k-Lipschitz function during training. So, for every gradient update, we clip the weights of our gradients between a lower bound and upper bound, say between -0.01 and +0.01.

We know that the discriminator loss is given as:

Instead of maximizing, we convert this into minimization objective by adding a negative sign:

The generator loss is the same as we learned in vanilla GANs.

Thus, the loss function of the discriminator is given as:

The loss function of the generator is given as:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset