Giter Site home page Giter Site logo

gibbsnet's Introduction

GibbsNet

PyTorch implementation of GibbsNet: Iterative Adversarial Inference for Deep Graphical Models.

Requirements

  • Python 3
  • Pytorch
  • visdom

Usage

SVHN, CIFAR10 dataset are currently supported.

Train

$ python train.py --model=GibbsNet --batch_size=100 --lr=1e-5 --dataset=SVHN --sampling_count=20
$ python train.py --model=GibbsNet --batch_size=100 --lr=1e-5 --dataset=SVHN --gpu_ids=0,1 --sampling_count=20

Visualize

  • To visualize intermediate results and loss plots, run python -m visdom.server and go to the URL http://localhost:8097

Test

$ python test.py --test_count=20 --model=GibbsNet --repeat_generation=10
  • Test result will generate in ./[opt.test_dir]/[opt.model/, of which default value is ./test/GibbsNet/
  • Test result consists of real_[i].png files and fake_[i]_[j].png files. real_[i].png files are sampled from real dataset, and fake_[i]_[j].png files are generated from sampled latent variable of real_[i].png

Results

1. SVHN

  • epoch 100, lr 1e-5, sampling_count 20
  • generated results


2. CIFAR10

  • Working in Progress

Implementation detail

  • Original implementation of discriminator network for CIFAR10 dataset uses maxout activation layer, but this implementation uses leaky ReLU rather than maxout layer because of lack of GPU memory.
  • all hyper parameters references to paper Adversarially Learned Inference.
  • To train GibbsNet, appropriate learning rate is 1e-5 for sampling count 20. You can increase learning rate when you sample less than 20 times.

TODOs

  • Custom dataset support
  • Visualize test results

Code reference

Visualization code(visualizer.py, utils.py) references to pytorch-CycleGAN-and-pix2pix(https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix) by Jun-Yan Zhu

Author

Tony Kim

gibbsnet's People

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.