Skip to content

kb10241024/Generative_Models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

Generative_Models

This repository is aimed with to build different types of Generative Models.
Till now, I've implemented DC-GAN(Deep Convolution Generative Adverserial Networks) only!

GANs

Generative Adversarial Networks (GANs) are one of the most interesting ideas in computer science today. Two models are trained simultaneously by an adversarial process. A generator ("the artist") learns to create images that look real, while a discriminator ("the art critic") learns to tell real images apart from fakes.

A diagram of a generator and discriminator

During training, the generator progressively becomes better at creating images that look real, while the discriminator becomes better at telling them apart. The process reaches equilibrium when the discriminator can no longer distinguish real images from fakes.

A second diagram of a generator and discriminator

This notebook demonstrates this process on the MNIST dataset. The following animation shows a series of images produced by the generator as it was trained for 50 epochs. The images begin as random noise, and increasingly resemble hand written digits over time.

sample output

The Generator

The generator uses tf.keras.layers.Conv2DTranspose (upsampling) layers to produce an image from a seed (random noise). Start with a Dense layer that takes this seed as input, then upsample several times until you reach the desired image size of 28x28x1. Notice the tf.keras.layers.LeakyReLU activation for each layer, except the output layer which uses tanh.

The Discriminator

The discriminator is a CNN-based image classifier.

Discriminator loss

This method quantifies how well the discriminator is able to distinguish real images from fakes. It compares the discriminator's predictions on real images to an array of 1s, and the discriminator's predictions on fake (generated) images to an array of 0s.

Generator loss

The generator's loss quantifies how well it was able to trick the discriminator. Intuitively, if the generator is performing well, the discriminator will classify the fake images as real (or 1). Here, we will compare the discriminators decisions on the generated images to an array of 1s.

References

NIPS 2016 Tutorial: Generative Adversarial Networks
GAN — DCGAN (Deep convolutional generative adversarial networks)
MIT's Intro to Deep Learning course.

Contributing

Anyone interested in GANs and other generative models like VAEs, are always welcome to contribute and feel free to contact me.

About

Repository for different genrative models such as Variational AutoEncoders and most popular GANs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors