Giter VIP home page Giter VIP logo

vat's Introduction

Virtual Adversarial training (VAT) implemented with Theano

Python code for reproducing the results showed in the paper:"Distributional Smoothing with Virtual Adversarial Training" http://arxiv.org/abs/1507.00677

Required libraries

python 2.7, numpy 1.9, theano 0.7.0, docopt 0.6.2

Examples on synthetic dataset

Model's contours on synthetic datasets with different regularization methods (Fig.3,4 in our paper)

./vis_model_contours.sh

The coutour images will be saved in ./figure.

Examples on MNIST dataset

Download mnist.pkl

cd dataset
./download_mnist.sh

###VAT for supervised learning on MNIST dataset

python train_mnist_sup.py --cost_type=VAT_finite_diff --epsilon=2.1 --layer_sizes=784-1200-600-300-150-10 --save_filename=<filename>

###VAT for semi-supervised learning on MNIST dataset (with 100 labeled samples)

python train_mnist_semisup.py --cost_type=VAT_finite_diff --epsilon=0.3 --layer_sizes=784-1200-1200-10 --num_labeled_samples=100 --save_filename=<filename>

After finish training, the trained classifer will be saved with <filename> in ./trained_model.

You can obtain a test error of the trained classifier saved with <filename> by the following command:

python test_mnist.py --load_filename=<filename>

.

If you find bug or problem, please report it!

vat's People

Contributors

takerum avatar

Watchers

James Cloos avatar David Krueger 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.