TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial…

Follow publication

Member-only story

Create New Animals using DCGAN with PyTorch

Tim Cheng
TDS Archive
Published in
3 min readMar 20, 2022
Figure 1. DCGAN from animal faces. Image created by author with the help of Unsplash.

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…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Tim Cheng
Tim Cheng

Written by Tim Cheng

Oxford CS | Top Writer in AI | Posting on Deep Learning and Vision

No responses yet

Write a response