Giter VIP home page Giter VIP logo

swae-pytorch's Introduction

Sliced-Wasserstein Autoencoder - PyTorch

Run on FloydHub

Implementation of "Sliced-Wasserstein Autoencoder: An Embarrassingly Simple Generative Model" using PyTorch with reusable components.

Quick Start

This repo requires Python 3.x.

To quickly get started training with the Sliced Wasserstein Autoencoder and running the MNIST example install the swae python package and dev dependencies.

  1. Pull down this repo and run pip install [-e] swae-pytorch/
  2. Change directories into the base of this repo and run pip install -r requirements-dev.txt
  3. Run python examples/mnist.py --datadir <place-to-save-data> --outdir <place-to-save-outputs>

Outputs

MNIST

In the mnist.py example, three Sliced Wasserstein Autoencoders were each trained using one of the 2D distributions used in the original paper. Below are examples of each at the end of 30 epochs using the same optimization parameters. Minor discrpencies between the original Keras figures and the PyTorch ones below maybe attributed to unaccounted for defaults and/or initializations.

2D Latent Space Test Samples Reconstructions

LSUN [Work In Progress]

In the lsun.py example, we attempt to show case how the Sliced Wasserstein Autoencoder performs on other datasets. Inspired by the original CelebA implementation in the Wasserstein Autoencoder paper, we rebuild an autoencoder similar to the architecture used in DCGAN. Additionally, we increase the number of projections to estimate the Sliced Wasserstein distance.

Due to limited compute resources, I am unable to effectively search the hyperparameter space at this time. Any help here would be greatly appreciated. Some ideas would be to implement some early stopping mechanism in PyTorch combined with some Random or Bayesian inspired search algorithm.

Below is the current state using: 500 projections, the Adam optimizer, sliced wasserstein distance weight of 10, and a 64 dimensional latent space with a gaussian prior.

Test Samples Reconstructions

References

Code

  • Original SWAE Keras implementation by skolouri
  • Original WAE TensorFlow implementation tolstikhin

Papers

swae-pytorch's People

Contributors

eifuentes avatar audrius-st avatar

Watchers

James Cloos avatar

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.