Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 2.75 KB

README.md

File metadata and controls

62 lines (47 loc) · 2.75 KB

Conditional Generative Adversarial Networks

Demonstration of deterministic control of image samples. We tweak conditional information to first make the sampled faces age, then again to make them smile.

The code in this repository implements the conditional generative adversarial network (cGAN), described in my paper from late 2015:

Conditional generative adversarial networks for convolutional face generation. Jon Gauthier. March 2015.

This code is a fork of the original GAN repository. The original GAN model is described in the paper:

Generative Adversarial Networks. Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio. ArXiv 2014.

Guide to the code / usage instructions

This code is built on the Pylearn2 framework for machine learning. The abstract model structures are implemented as Python classes (see e.g. the ConditionalAdversaryPair class, and concrete model instantiations / training configurations are described in YAML files (see e.g. a file for training with LFW data).

You can perform your own training runs using these YAML files. The paths in the YAML files reference my own local data; you'll need to download the LFW dataset and change these paths yourself. The "file-list" and embedding files referenced in the YAML files are available for LFW in the data/lfwcrop_color folder. Once you have the paths in the YAML file, you can start training a model with the simple invocation of Pylearn2's train.py binary, e.g.

train.py models/lfwcrop_convolutional_conditional.yaml

Visualizations

The sampler folder contains various GAN sampling scripts that helps visualize trained models. Some highlights are listed below (see the head of the linked source files for descriptions).

Requirements

  • Numpy
  • Theano
  • Pylearn2