Member-only story
Create New Animals using DCGAN with PyTorch
Learning features from wildlife to generate new creatures

Generative networks have opened up a plethora of fun projects one can do with deep learning — one of which is generating images based on a set of realistic photos. We can see in our previous article that a very simple GAN network can have good results on generating numbers; but what if we have a much more complicated dataset, say a bunch of wild animals? What will a GAN generate after seeing foxes, tigers, and lions all together? In this tutorial, let's build this experiment using PyTorch and find out.
Side Note: This article assumes prior knowledge of generative adversarial networks. Please refer to this previous article for more information on GANs.
DCGAN in PyTorch
To test this, we will need to create a more complicated GAN, preferably a DCGAN where we involved convolutions for the generation. The convolutions make them much suitable for learning image representations. The architecture is a lot more complicated than the FC layers from the previous GAN we built, as we have to incorporate transpose convolutions during the generation stage. Luckily, PyTorch provides a very in-depth tutorial themselves in creating a workable generator and discriminator, so we will directly use the…