Code Monkey home page Code Monkey logo

bn-vae's Introduction

BN-VAE

This is the pytorch implementation of the paper:

A Batch Normalized Inference Network Keeps the KL Vanishing Away

Acknowledgements

Thanks for sharing the code to public! A large portion of this repo is borrowed from https://github.com/jxhe/vae-lagging-encoder and https://github.com/bohanli/vae-pretraining-encoder

Requirements

  • Python >= 3.6
  • PyTorch >= 1.0
  • pip install editdistance

Data

Datasets used in the paper can be downloaded with:

python prepare_data.py
python prepare_data_yelp_yahoo.py

Usage

Train a AE if you want

python text_beta.py \
    --dataset yahoo \
    --beta 0 \
    --lr 0.5

Train VAE with different algorithms, check parameters "--fb", if you want to use bn-vae, remember set args.gamma. An example of training:

python text_anneal_fb.py \
    --dataset yahoo \
    --kl_start 0 \
    --warm_up 10 \
    --target_kl 8 \
    --fb 0 \
    --lr 0.5
    --gamma 0.5

bn-vae's People

Contributors

valdersoul avatar bohanli 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.