Code Monkey home page Code Monkey logo

dstrf's Introduction

DSTRF

A toolbox for dynamic spectrotemporal receptive field (dSTRF) analysis, as introduced in "Estimating and interpreting nonlinear receptive field of sensory neural responses with deep neural network models". In short, dSTRF is a method to analyze which parts of the input at any time point are being used by a feed-forward deep neural network to predict the response.

In mathematical terms, for a nonlinear model f(⋅), input at time t, Xt, and output at time t, Yt = f(Xt), the dSTRF is the locally linear transformation Wt, such that: Yt = Wt Xt. Now, if f(⋅) is a linear function, Wt will be the same for all t. If not, the linearized function applied to the input (Wt) will depend on the given stimulus (Xt), which is the case in a deep neural network.

A linear function mapping the auditory stimuli in the spectrotemporal domain (i.e., auditory spectrograms) to the neural activity recorded from the biological brain is called a spectrotemporal receptive field (STRF). Since we use a nonlinear mapping between the stimulus and response, and characterize it as a locally linear function at each time point, we call this a dynamic spectrotemporal receptive field (dSTRF).

Note that for the equality condition Yt = Wt Xt to hold for all t, the intermediate layers should have no bias term, and ReLU or LeakyReLU activations. In this case, the Yt / Xt is equivalent to the derivative of Y with respect to X, at Xt, i.e., the Jacobian matrix of function f(⋅). If the above conditions are not satisfied, the Jacobian will only be approximating Yt / Xt.

Usage

This toolbox has two main modules:

  1. modeling: This module contains functions to fit and evaluate neural activity encoding models. The training supports cross-validation, and data jackknifing. It also contains two sample Encoder classes that map audio spectrogram to neural activity— a linear model, and a deep convolutional model.

  2. estimate: This module contains all functions necessary to compute dSTRFs and analyze their nonlinear characteristics. The dSTRF estimation supports cross-validation and data jackknifing to be used with cross-validated and jackknifed training introduced in the above module.

All the main functionality of the toolbox, along with some examples is demonstrated in the Tutorial notebook.

Installation

To install or update this package through pip, run the following command:

pip install git+https://github.com/naplab/DSTRF.git

To-do

  • Test for possible bugs
  • Fix code documentation

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.