Giter VIP home page Giter VIP logo

hann's Introduction

HANN

Repository for our preprint VC dimension of partially quantized neural networks in the overparametrized regime.

This repo is ran with the following software (versions)

python 3.8
tensorflow 2.5.0
larq 0.12.0
numpy 1.19.5

Downloading datasets

mkdir results
chmod +x download_UCI_datasets.sh
./download_UCI_datasets.sh

What does the above do?

  1. Downloads data_py.zip (39 MB) from 'http://www.bioinf.jku.at/people/klambauer/data_py.zip'. This link is listed at the Self-Normalizing Network repository https://github.com/bioinf-jku/SNNs.
  2. Unzips data_py.zip to data/ (268M when unzipped).
  3. Cleans up the naming conventions of the subdirectories of data/ and deletes an unused file (data/abalone_dat.py) in the directory.
  4. Make a copy of _datasets.py to datasets.py and append the full directory path to the file, so that the data files can be found.

Run experiments

Run everything

Warning! This may take some time. For testing purposes, we recommend running the smaller jobs (see next section). We also have Python/Slurm script for running this on a cluster (see the section after the next section).

python run_batch_experiments.py --datalist all --algorithm HANN15OCE
python run_batch_experiments.py --datalist all --algorithm HANN100OCE

Run a small testing panel

Small testing panel (3 datasets: iris, ionosphere, wine)

python run_batch_experiments.py --datalist testing --algorithm HANN15OCE

Run on a cluster managed by Slurm

The Slurm script is automatically generated by and submitted to your compute cluster by SLURM_run_batch_experiments.py.

You need to manually specify the following variables:

YOUR_EMAIL                    # optional, delete this line if not needed
YOUR_ACCOUNT
COMPLETE_DIRECTORY_TO_HANN    # absolute directory to where this code directory is located on your harddrive

After filling in the above information, run

python SLURM_run_batch_experiments.py --datalist testing --algorithm HANN15OCE --cpus 1

Increase the cpus if you have more cpus per compute node.

Plot figures

The figures are produced in the following jupyter notebooks:

Synthetic data

example_moons.ipynb

example_moons_ste_vs_swish.ipynb

121 UCI datasets

figures_OCE.ipynb

Weston-Watkins

First run

python run_batch_experiments.py --datalist all --algorithm HANN15
python run_batch_experiments.py --datalist all --algorithm HANN100

Then go to figures_WW.ipynb

Other information

wu2018tableA1.csv is Table A1 from the supplemental materials of https://papers.nips.cc/paper/2018/hash/e32c51ad39723ee92b285b362c916ca7-Abstract.html

hann's People

Contributors

yutongwangumich avatar

Stargazers

Nikita Yudin avatar

Watchers

James Cloos avatar  avatar

Forkers

adamnemecek

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.