Code Monkey home page Code Monkey logo

inductive-pooling's Introduction

Inductive Bias of Deep Convolutional Networks through Pooling Geometry

This repository contains scripts for reproducing the experiments in the paper Inductive Bias of Deep Convolutional Networks through Pooling Geometry.

Disclaimer

Due to inherent randomness in the experiments, obtained results might differ slightly from those reported in the paper. Qualitatively however, full compliance with the paper is expected.

Installation

The repository includes as a submodule the Caffe fork of the SimNets Architecture. To clone the repository along with the submodule, call git clone with its --recursive flag:

git clone --recursive https://github.com/HUJI-Deep/inductive-pooling.git

After cloning, make sure to install the Python package versions listed in requirements.txt:

pip install -r requirements.txt

Finally, go to the SimNets submodule in deps/simnets and follow its installation instructions.

Running the Experiments

The experiments in the paper are based on a synthetic classification benchmark consisting of images displaying random shapes ('blobs'). Two labels are assigned to images, ranking properties of the displayed blob:

  • closure: how morphologically closed the blob is
  • symmetry: how left-right symmetric the blob is about its center

Convolutional networks with two pooling geometries are evaluated:

  • square: standard contiguous square windows
  • mirror: pooling windows join together nodes with their spatial reflections

It is shown that different pooling geometries lead to superior performance in different tasks. Specifically, square pooling outperforms mirror on the task of closure ranking, whereas the opposite occurs when ranking symmetry.

Scripts for running the experiments are under exp/blob. generate_blob.py can be called directly to generate the dataset, though this is not necessary (running a convolutional network will generate the dataset automatically in case it is missing).

The folder exp/blob/cac contains scripts for evaluating convolutional arithmetic circuits (convolutional networks with linear activation and product pooling):

  • net.prototmp: template for prototxt specifying network architecture and training scheme
  • train_plan.json: list of values for the unspecified parameters in net.prototmp
  • train.py: substitutes the values in train_plan.json into net.prototmp and trains the network, measuring its train and test accuracies along the way

By default, calling train.py initiates 4 runs, corresponding to the different combinations of closure/symmetry task and square/mirror pooling. The gaps in performance (square pooling better than mirror for closure, opposite for symmetry) should be evident.

To evaluate convolutional rectifier networks (convolutional networks with ReLU activation and max or average pooling), go to exp/blob/crn. This folder contains the exact same files as exp/blob/cac, implementing the exact same functionalities. The only difference (from the user's perspective) is that calling train.py initiates 8 runs instead of 4, corresponding to the fact that every setting is run twice -- once with average pooling, and once with max pooling.

You are welcome to alter the architectural and optimization parameters of the networks. In particular, network breadth (number of channels in hidden layers) can be configured in train_plan.json, and network depth can be set by modifying net.prototmp.

Important Note

Please do not move any of the scripts mentioned above, as they all rely on their original path relative to the root of the repository.

inductive-pooling's People

Contributors

cohennadav avatar

Watchers

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