Coder Social home page Coder Social logo

adversarial-autoencoder's Introduction

Adversarial-Autoencoder

A convolutional adversarial autoencoder implementation in pytorch using the WGAN with gradient penalty framework.

There's a lot to tweak here as far as balancing the adversarial vs reconstruction loss, but this works and I'll update as I go along.

The MNIST GAN seems to converge at around 30K steps, while CIFAR10 arguably doesn't output anything realistic ever (compared to ACGAN). Nonetheless it starts to looks ok at around 50K steps

The autoencoder components are able to output good reconstructions much faster than the GAN. ~10k steps on MNIST. The auto encoder is currently bad with CIFAR10 (under investigation)

Note

There is a lot here that I want to add and fix with regard to image generation and large scale training.

But I can't do anything until pytorch fixes these issues with gradient penalty here

MNIST Gaussian Samples (GAN) - 33k steps

output image

MNIST Reconstructions (AE) - 10k steps

output_image

CelebA 64x64 Gaussian Samples (GAN) - 50k steps

output_image

CIFAR10 Gaussian Samples (GAN) - 200k steps

output image

CIFAR10 Reconstructions (AE) - 80k steps

output image

clearly need to fix this

Requirements

  • pytorch 0.2.0
  • python 3 - but 2.7 just requires some simple modifications
  • matplotlib / numpy / scipy

Usage

To start training right away just run

start.sh

To train on MNIST

python3 train.py --dataset mnist --batch_size 50 --dim 32 -o 784

To train on CIFAR10

python3 train.py --dataset cifar10 --batch_size 64 --dim 32 -o 3072

Acknowledgements

For the wgan-gp components I mostly used caogang's nice implementation

TODO

Provide pretrained model files from on a google drive folder (push loader).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.