Generating Images Using GANs

So far, we have learned about the discriminative model, which learns to discriminate between the classes. That is, given an input, it tells us which class they belong to. For instance, to predict whether an email is a spam or ham, the model learns the decision boundary that best separates the two classes (spam and ham), and when a new email comes in they can tell us which class the new email belongs to.

In this chapter, we will learn about a generative model that learns the class distribution, that is, the characteristics of the classes rather than learning the decision boundary. As the name suggests, with the generative models, we can generate new data points similar to the data points present in the training set.

We will start off the chapter by understanding the difference between the discriminative and generative models in detail. Then, we will deep dive into one of the most popularly used generative algorithms, called Generative Adversarial Networks (GANs). We will understand how GANs work and how they are used to generate new data points. Going ahead, we will explore the architecture of GANs and we will learn about the loss function. Later, we will see how to implement GANs in TensorFlow to generate handwritten digits.

We shall also scrutinize the Deep Convolutional Generative Adversarial Network (DCGAN), which acts as a small extension to the vanilla GAN by using convolutional networks in their architecture. Going forward, we will explore Least Squares GAN (LSGAN), which adopts the least square loss for generating better and quality images.

At the end of the chapter, we will get the hang of Wasserstein GAN (WGAN) which uses the Wasserstein metric in the GAN's loss function for better results.

The chapter will cover the following topics:

  • Differences between generative and discriminative models
  • GANs
  • Architecture of GANs
  • Building GANs in TensorFlow
  • Deep convolutional GANs
  • Generating CIFAR images using DCGAN
  • Least Squares GANs
  • Wasserstein GANs
..................Content has been hidden....................

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