Loss function

Now that, we have learned that the least square loss function improves the generator's image quality, how can we rewrite our GANs loss function in terms of least squares?

Let's say a and b are the actual labels for the generated images and real images respectively, then we can write the loss function of the discriminator in terms of least square loss as follows:

Similarly, let's say c is the actual label that the generator wants the discriminator to believe that the generated image is the real image, so label c represents the real image. Then we can write the loss function of a generator in terms of least square loss as follows:

We set labels for real images as 1 and for fake images 0, so b and c become 1 and a becomes 0. So, our final equation can be given as follows:

The loss function of the discriminator is given as follows:

The loss function of the generator is given as follows:

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

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