Code Monkey home page Code Monkey logo

vae-pytorch's Introduction

Variational Autoencoder

Implementation of VAE using Pytorch

Original Paper on VAE

Nice video explaining intuition behind it

Results below were achieved after training on these datasets:

VAE with discriminator

In order to increase sharpness of images generated by plain VAE, model called discriminator was added at the end of generation process. So in this case VAE can be viewed as a generator in a GAN model, which will have to optimize reconstruction loss and so-called adversarial loss simultaneously.

Plain VAE

Training

To train on your dataset specify path to it in config.py ROOT_DIR variable

Also you can tweak all the hyperparameters except for IMG_SIZE must be power of 2 (32, 64, 128, etc.) and images in dataset supposed to have equal length and width

After you are all set just run

python train_vae.py 

or

python train_vae_with_discriminator.py

in case you want sharper images to be generated after training

Generating images with pretrained models

There are four available models to generate images

Script below has some parameters which can be viewed with specifying -h

Without any of them it will just generate anime face with plain VAE and put it in generated_images directory

python generate_image.py

vae-pytorch's People

Contributors

petro-lv avatar

Stargazers

Oleksiy Labiak avatar  avatar  avatar  avatar

Watchers

 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.