Skip to content

gmalivenko/cat-gan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cat GAN

This is the GAN implementation of cats generator.

What is the GAN? Generative adversarial networks (GANs) are a class of artificial intelligence algorithms used in unsupervised machine learning, implemented by a system of two neural networks contesting with each other in a zero-sum game framework (link). So, it means that we should train 2 networks with different architectures and in different ways.

Architecture

Generator

The generator has very custom but straightforward architecure. ConvTranspose2d -> SELU -> [ConvTranspose2d -> SELU] x N -> ConvTranspose2d -> Tanh

Discriminator

A ResNet-18 with single-neuron output seems compatible for this project.

The generator has very custom but straightforward architecure. ConvTranspose2d -> SELU -> [ConvTranspose2d -> SELU] x N -> ConvTranspose2d -> Tanh

Examples

The output on 5k iteration (for default configuration): 2017-11-15 21-42-34 5 minute after: 2017-11-15 21-47-37 2 hours after: 2017-11-16 00-07-49

Installation

pip install -r requirements.txt

For the PyTorch installation, please follow this guide.

Training

To run the training script, make changes in the configuration (example is in config/train.yml).

python train.py --config config/train.yml

Testing

To get radom cat (fill restore.generator in config/train.yml):

python test.py --config config/train.yml

2017-11-18 01-18-30 2017-11-18 01-18-49

References

Inspired by https://arxiv.org/abs/1406.2661

License

This software is covered by MIT License.