Giter VIP home page Giter VIP logo

liblinear's Introduction

This is the repository that accompanies the manuscript "An exact solver for the Weston-Watkins SVM subproblem".

Basic usage

To train the WW-SVM on mnist.scale -- downloadable from LIBSVM Data: Classification (Multi-class) -- run the following in console:

make
wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/mnist.scale.bz2
bunzip2 mnist.scale.bz2
./train -s 30 -c 1 -t 64 mnist.scale

The -s 30 flag is for choosing the Walrus solver for the linear WW-SVM. Alternatively, the -s 31 flag is for choosing the Shark solver for the linear WW-SVM. The -c 1 flag is for setting the regularizer to 1. The -t 64 sets the max outer iterations to 64.

To run the trained model on test set:

wget https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass/mnist.scale.t.bz2
bunzip2 mnist.scale.t.bz2
./predict mnist.scale.t mnist.scale.model output

Stopping criterion

The default stopping criterion is when the duality gap decays by a factor of 0.0009 relative to right after the first iteration. See the manuscript for more details.

This can be changed by modifying

#define STOPPING_CRITERION 0.0009

to a different value.

Reproducing the figures from the manuscript

After cloning the repository run the following in the console

chmod +x reproduce_figures.sh
./reproduce_figures.sh

This script performs the following:

  1. Download all the datasets
  2. Run the Walrus and Shark solver on each dataset over the hyperparameter grid of size 10: [2^(-6), 2^(-5), ..., 2^3]

After the above script finishes, make sure the following Python packages are installed:

pandas
numpy
matplotlib
seaborn
re

Finally, go to the Jupyter notebook experiments/analyze.ipynb and hit run all.

liblinear's People

Contributors

yutongwangumich avatar cjlin1 avatar infwinston avatar ycjuan avatar jyhsia5174 avatar b92paul avatar ppetter1025 avatar yongzhuang22 avatar mosikico avatar hychou0515 avatar chiahuaho avatar chuboyu avatar chieh-yen avatar jeremy89183 avatar leepei avatar hsinyuan-huang avatar will945945945 avatar zyque avatar

Stargazers

Toby Dylan Hocking avatar

Watchers

James Cloos avatar

Forkers

zshwuhan

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.