Code Monkey home page Code Monkey logo

perforated-cnn-matconvnet's Introduction

perforated-cnn-matconvnet

PerforatedCNNs accelerate convolutional neural networks (CNNs) by skipping evaluation of the convolutional layers in some of the spatial positions. See the paper for more details:

Michael Figurnov, Dmitry Vetrov, Pushmeet Kohli. PerforatedCNNs: Acceleration through Elimination of Redundant Convolutions. Under review as a conference paper at ICLR 2016 [arXiv].

The code is based on MatConvNet from December 2014, with some backports (such as more aggressive memory savings for ReLU).

Installation

Clone the repository, run MATLAB, go to acceleration directory. Compile the code:

setup;
vl_compilenn('enableGpu', true, 'enableImReadJpeg', true);

Run some tests:

vl_test_nnconv_perf(0); vl_test_nnconv_perf(1);
vl_test_nnpool_fast(0); vl_test_nnpool_fast(1);

Experiment: perforation of whole network

See sections 3.3 and 4.3 of the paper for details.

Download .mat files with network weights and CIFAR-10 dataset from here. Put them into the root folder. Navigate into acceleration directory. There is a script per network:

  1. Network in Network for CIFAR-10: cifar_greedy_perforation
  2. AlexNet: alexnet_greedy_perforation
  3. VGG-16: vgg_greedy_perforation

Set dataDir path in the AlexNet and VGG-16 scripts if you want to build perforated networks for ImageNet. Change the useGpuTimings setting to select the target device for a perforated network (CPU or GPU). Example:

setup;
cifar_greedy_perforation('useGpuTimings', true);

MatConvNet's original README

MatConvNet is a MATLAB toolbox implementing Convolutional Neural Networks (CNNs) for computer vision applications. It is simple, efficient, and can run and learn state-of-the-art CNNs. Several example CNNs are included to classify and encode images. Please visit the homepage to know more.

perforated-cnn-matconvnet's People

Contributors

vedaldi avatar lenck avatar mfigurnov avatar jaderberg avatar

Watchers

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