Giter Club home page Giter Club 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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vat's Issues

Calculating Misclassification Rates on Test Set

Would be very helpful to have code that calculates misclassification rates in a test.py script, so anyone could try to replicate the results that the paper obtained. Especially since that code must already be written!

Semisup example uses 1000 instead of 100 samples

The semisupervised MNIST example uses the default value of 1000 labeled samples instead of 100 labeled samples (as stated in the README). The given hyperparameters also only work for the 1000 sample case.

Could you give details on hyperparameters for the 100 sample setting?

Reproducing results from Synthetic Datasets

Would also be great to have code that reproduces the synthetic datasets.
Even better to create the plots that visualized the decision boundary contours.

Thank you so much again for releasing this code to the public! ๐Ÿ‘

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.