GithubHelp home page GithubHelp logo

cvae's Introduction

Conditional Variational Autoencoder (cVAE) using PyTorch

Description:

Explore the power of Conditional Variational Autoencoders (CVAEs) through this implementation trained on the MNIST dataset to generate handwritten digit images based on class labels. Utilizing the robust and versatile PyTorch library, this project showcases a straightforward yet effective approach to conditional generative modeling.

Key Features:

  • Thorough implementation of CVAE as delineated in the seminal paper(https://arxiv.org/abs/1312.6114).
  • Streamlined training and evaluation workflows for the MNIST dataset.
  • Real-time visualization of generated digit images during training, alongside epoch-wise saved image outputs.
  • Modular and well-commented code for ease of customization, extension, and detailed understanding.

Table of Contents:

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/unnir/cVAE.git
    cd cVAE
  2. (Optional) It's advisable to create a virtual environment to manage dependencies:

    python -m venv env
    source env/bin/activate  # On Windows, use +env\Scripts\activate+
  3. Install the necessary libraries:

    pip install torch torchvision

Usage

  1. Make sure the MNIST dataset is downloaded in the +../data+ directory, or modify the path in the script to your dataset location.
  2. Run the main script to initiate training and evaluation of the CVAE model:
    python main.py

Output

  • Real-time console output of training and testing loss values.
  • Generated digit images during training saved as +reconstruction_.png+ and sampled images from the latent space saved as +sample_.png+ in the current directory.

Contributing

Feel free to fork the project, open issues, and submit Pull Requests. For major changes, please open an issue first to discuss what you would like to change.

License

MIT(https://choosealicense.com/licenses/mit/)

References

  1. Auto-Encoding Variational Bayes(https://arxiv.org/abs/1312.6114) - Kingma and Welling's paper on Variational Autoencoders.
  2. PyTorch Documentation(https://pytorch.org/docs/stable/index.html) - Official documentation and tutorials.
  3. MNIST dataset(http://yann.lecun.com/exdb/mnist/) - Source of the MNIST dataset used in this project.

Author

Vadim Borisov

cvae's People

Contributors

unnir avatar shulgin-s 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.