Understanding Generative Adversarial Networks

Naoki
6 min readNov 3, 2017

If you see the above image and it does not make much sense, this article is written for you. I explain how GAN works using a simple project that generates hand-written digit images.

I use Keras on TensorFlow and the notebook code is available in my Github.

Background

GAN (Generative Adversarial Network) is a framework proposed by Ian Goodfellow, Yoshua Bengio and others in 2014.

A GAN can be trained to generate images from random noises. For example, we can train a GAN to generate digit images that look like hand-written digit images from MNIST database.

MNIST hand-written digit images

A GAN has two parts in it: the generator that generates images and the discriminator that classifies real and fake images.

The Generator

The input to the generator is a series of randomly generated numbers called latent sample. Once trained, the generator can produce digit images from latent samples.

Our generator is a simple fully connected network that takes a latent sample (100 randomly generated numbers) and produces 784 data points which can be reshaped…

--

--