Using DCGANs to generate face images
In the previous section, we learned about generating images using GANs. However, we have already seen in Chapter 4, Introducing Convolutional Neural Networks, that Convolutional Neural Networks (CNNs) perform better in the context of images when compared to vanilla neural networks. In this section, we will learn about generating images using Deep Convolutional Generative Adversarial Networks (DCGANs), which use convolution and pooling operations in the model.
First, let’s understand the technique we will leverage to generate an image using a set of 100 random numbers (we chose 100 random numbers so that the network has a reasonable number of values to generate images. We encourage readers to experiment with different amounts of random numbers and see the result). We will first convert noise into a shape of batch size x 100 x 1 x 1.
The reason for appending additional channel information in DCGANs and not doing it in the GAN section...