Giter VIP home page Giter VIP logo

retinalresources's Introduction

RetinalResources

This code implements experiments described in the paper "A Unified Theory of Early Visual Representations from Retina to Cortex through Anatomically Constrained Deep CNNs", to be presented at ICLR 2019 (https://openreview.net/pdf?id=S1xq3oR5tQ). The code runs properly using Python 3.5.2, Tensorflow 1.1.0, Cuda 8.0, and Keras 2.1.3 (other versions may work as well but there is no guarantee). Training one model takes several hours on a CPU, but only a few minutes (< 10 minutes) on a Titan X GPU.

-- BottleneckYieldsCenterSurround.ipynb reproduces a core result of the paper, namely that enforcing a dimensionality bottleneck at an early layer of a CNN causes retina-like center-surround receptive fields to be learned (fig. 2A,B).

-- TrainModel.py implements the (parameterizable) model architecture and training scheme. Trained models are saved in the saved_models directory. Model performance histories are saved in the Logs directory.

-- TrainAllModels.ipynb uses TrainModel.py to train multiple model architectures with specified parameters, for multiple trials (i.e. different random weight initializations).

-- PlotPerformance.ipynb is used to show the performance (on the CIFAR 10 test set, after training) of different model architecture parameter settings (fig. 1D).

-- VisualizeRFs.py implements the code that computes and produces visualizations of the receptive fields of trained convolutional channels. Visualizations are saved in the saved_visualizations directory with file names that indicate the model parameter settings and trial number. Numpy matrices representing the receptive fields are saved in the saved_filters directory, and relevant model weight matrices (i.e. the "V1" layer weights) are saved in the saved_weights directory (e.g. fig. 2).

-- VisualizeRFsRandomInits.py is similar to VisualizeRFs.py, but computes the first-order approximations of convolutional channel receptive fields using gradient ascent starting from multiple (ten) different random initializations rather than from a blank stimulus. These are used for the simple vs. complex cell analysis described in the paper (fig. 5).

-- ProcessAllRFs.py calls VisualizeRFs.py and VisualizeRFsRandomInits.py for trained models with specified parameters and trial numbers.

-- CalculateLinearityAndLinearSeparability.ipynb computes the linearity of layer responses and the linear separability of object classes in layer activation space for all models and layers (fig. 3 A,B,C,D,F, fig. 8). It also computes linearity and linear separability of individual convolutional channels within a layer(Fig. 7), as well as visualizes activations at the bottleneck layer (Fig. 9)

-- Quantify_Orientedness.ipynb quantifies and visualizes (in polar plots) the orientedness / isotropy of the relevant model receptive fields, as well as of model weight matrices (fig. 4).

-- Quantify_Complexity.ipynb quantifies the extent to which first-order approximations of model receptive fields vary according to the random initialization used in the gradient ascent approximation (fig. 5).

In progress: architecture with LGN (fig 2D), local normalization layers (fig 6), untied weights experiment (fig 2E,F).

retinalresources's People

Contributors

jlindsey15 avatar saocko avatar stphtphsn avatar

Watchers

 avatar  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.