Code Monkey home page Code Monkey logo

wide_resnets_keras's Introduction

Keras implementation of "Wide Residual Networks"

This repo contains the code to run Wide Residual Networks using Keras.

Dependencies:

  • numpy, Keras and it's dependencies (including the default tensorflow backend) can be installed with:
    • sudo apt-get install python-pip python-dev gfortran libblas-dev liblapack-dev libhdf5-serial-dev libatlas-base-dev
      • Note BLAS/LAPACK/ATLAS make linear algebra/numpy operations much much faster (check numpy was installed against numpy with import numpy as np; np.__config__.show() ), and HDF5 dependencies allow saving/loading of trained models.
    • sudo pip install -r requirements.txt which includes TensorFlow backend (now the Keras default); alternatively install the Theano backend with sudo pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
  • To plot the architecture of the model used (like the plot of the WRN-16-2 architecture plotted below), you need to install pydot and graphviz. I had to install the C-version for graphviz first (following comments in this issue):
$ sudo apt-get install graphviz
$ sudo pip install -I pydot==1.1.0
$ sudo pip install -I graphviz==0.5.2

Training Details:

Run the default configuration (i.e. best configuration for CIFAR10 from original paper/code, WRN-28-10 without dropout) with:

$ python main.py

There are three configuration sections at the top of main.py:

Results and Trained models:

  • WRN-40-4 no dropout:
    • Using the same values in main.py except depth=40 and k:=widen-factor=4, I obtained a test loss = 0.37 and accuracy = 0.93. This test error (i.e. 1 - 0.93 = 7%) is a little higher than the reported result (Table 4 states the same model obtains a test error of 4.97%); see the note below for a likely explanation.
    • You can find the trained weights for this model at models/WRN-40-4.h5, whilst models/test.py provides an example of running these weights against the test set.
      • WARNING: These weights were obtained using the Theano backend - I am currently unable to reproduce these results using these trained weights with the TensorFlow backend.

Note: I have not followed the exact same preprocessing and data augmentation steps used in the paper, in particular:

  • "global contrast normalization", and
  • "random crops from image padded by 4 pixels on each side, filling missing pixels with reflections of original image", which appears to be implemented in this file.

Ideally, we will add such methods directly to the Keras image preprocessing script.

##WRN-16-2 Architecture WRN-16-2 Architecture

wide_resnets_keras's People

Contributors

asmith26 avatar

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.