https://github.com/alleninstitute/glifs_asc

GLIFS plus after spike currents

https://github.com/alleninstitute/glifs_asc

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.9%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

GLIFS plus after spike currents

Basic Info
  • Host: GitHub
  • Owner: AllenInstitute
  • License: other
  • Language: Python
  • Default Branch: main
  • Size: 1.32 GB
Statistics
  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 5 years ago · Last pushed almost 4 years ago
Metadata Files
Readme

README.md

Neuronal Heterogeneity Learned by Gradient Descent Improves Performance on Temporally Challenging Tasks

This repository contains code for the models and analysis used in the paper, "Neuronal Heterogeneity Learned by Gradient Descent Improves Performance on Temporally Challenging Tasks."

We develop a differentiable rate-based neuronal model that incorporates after-spike currents and term it the "generalized-leaky-integrate-and-firing-rate" model. We create networks using this model and train them on tasks, optimizing both neuronal parameters underlying intrinsic dynamics (e.g., threshold, membrane time constant) and synaptic weights.

Structure of codebase:

  • main: contains all code
  • main/config: contains configuration files for examples
  • main/data: folder to store data for training/testing
  • main/datasets: code to process training/testing data
  • main/examples: all code used for training/testing described in paper, including plotting code for generating figures
  • main/figures: supplementary figures and figures used in paper
  • main/models: main code for model utilization
  • main/training: utils functions for training
  • main/utils: other basic utils functions

Important files:

  • main/models/neurons.py: defines a GLIFR class for the rate based neuronal model, and a RNNC class for a vanilla RNN cell
  • main/models/pl_modules.py: defines a neural network using GLIFRs, a neural network using RNNCs, and a neural network using LSTMCell
  • main/utils/types.py: defines named tuples used as parameters in model code
  • main/models/analyzer.py: defines an analyzer class to run certain analyses on trained models
  • main/examples/train.py: main training code used in paper

Usage

The GLIFR class enables creation and usage of a differentiable layer of neurons that express biological dynamics including after-spike currents in a rate-based manner. One may optimize the neuron's intrinsic parameters (i.e., Vth, km, aj, rj, k_j) using standard gradient descent.

``` from models.neurons import GLIFR from utils.types import StructureParameters, NeuronParameters

structureparameters = StructureParameters(inputsize, hiddensize, outputsize) neuronparameters = NeuronParameters(dt, tau) neuron = GLIFR(structureparameters, neuron_parameters)

inputs = torch.randn(1, nsteps, inputsize) firing = torch.zeros((1, hiddensize)) voltage = torch.zeros((1, hiddensize)) syncurrent = torch.zeros((1, hiddensize)) ascurrents = torch.zeros((numascs, 1, hiddensize))

outputs = [torch.zeros((1, hiddensize)) for i in range(delay)] for i in range(nsteps): x = inputs[:, i, :] firing, voltage, ascurrents, syncurrent = neuron(x, firing, voltage, ascurrents, syncurrent, outputs[-delay]) # Set firing_delayed (i.e., last argument) to incorporate synaptic delay outputs.append(firing.clone()) ```

The GLIFRN class enables creation and usage of a single layer network of GLIF neurons in which inputs are weighted, propagated through a single layer of GLIFR neurons, and finally weighted. This class can also be used with PytorchLightning.

``` from models.plmodules import GLIFRN parser = ArgumentParser() addstructureargs(parser) addgeneralmodelargs(parser) GLIFRN.addmodelspecificargs(parser) args = parser.parseargs()

net = GLIFRN(**vars(args)) inputs = torch.randn(1, nsteps, input_size) outputs = neuron(inputs) ```

The file examples/train.py use command line arguments and the config files in main/config, which can be edited by the user, to run training simulations on the RNN, GLIFRN, and LSTM networks. The MNIST related tasks assume a data directory containing the MNIST dataset in standard format. Below are some example commands.

  • python3 train.py --task lmnist --ntrials 10 --numworkers 8 --accelerator gpu --gpus 2 --strategy ddpfindunusedparameters_false # Runs 10 trials of LMNIST training using 8 workers on the GPU (using 2 devices)
  • python3 train.py --task sine --ntrials 10 # Runs 10 trails of sine training on the CPU

The results we obtained are stored in main/examples/results, and the plotting and analysis code (main/examples/results/analysis) may be run with that.

Owner

  • Name: Allen Institute
  • Login: AllenInstitute
  • Kind: organization
  • Location: Seattle, WA

Please visit http://alleninstitute.github.io/ for more information.

GitHub Events

Total
  • Fork event: 1
Last Year
  • Fork event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 262
  • Total Committers: 2
  • Avg Commits per committer: 131.0
  • Development Distribution Score (DDS): 0.321
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
chloewin w****w@g****m 178
chloewin c****n@u****u 84
Committer Domains (Top 20 + Academic)
uw.edu: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

environment.yml conda
  • _libgcc_mutex 0.1
  • _openmp_mutex 4.5
  • absl-py 1.0.0
  • aiohttp 3.7.4.post0
  • async-timeout 3.0.1
  • attrs 21.4.0
  • blas 1.0
  • blinker 1.4
  • bottleneck 1.3.2
  • brotli 1.0.9
  • brotlipy 0.7.0
  • bzip2 1.0.8
  • c-ares 1.18.1
  • ca-certificates 2022.2.1
  • cached-property 1.5.2
  • cachetools 5.0.0
  • certifi 2021.10.8
  • cffi 1.15.0
  • chardet 4.0.0
  • charset-normalizer 2.0.12
  • click 8.0.3
  • colorama 0.4.4
  • cpuonly 2.0
  • cryptography 35.0.0
  • cycler 0.11.0
  • dbus 1.13.18
  • expat 2.4.4
  • fontconfig 2.13.1
  • fonttools 4.25.0
  • freetype 2.11.0
  • fsspec 2022.1.0
  • future 0.18.2
  • giflib 5.2.1
  • glib 2.69.1
  • gmp 6.2.1
  • gnutls 3.6.15
  • google-auth 2.6.0
  • google-auth-oauthlib 0.4.6
  • grpcio 1.42.0
  • gst-plugins-base 1.14.0
  • gstreamer 1.14.0
  • h5py 3.6.0
  • hdf5 1.10.6
  • icu 58.2
  • idna 3.3
  • importlib-metadata 4.11.1
  • intel-openmp 2021.4.0
  • jpeg 9d
  • kiwisolver 1.3.2
  • lame 3.100
  • lcms2 2.12
  • ld_impl_linux-64 2.35.1
  • libffi 3.3
  • libgcc-ng 9.3.0
  • libgfortran-ng 7.5.0
  • libgfortran4 7.5.0
  • libgomp 9.3.0
  • libiconv 1.15
  • libidn2 2.3.2
  • libpng 1.6.37
  • libprotobuf 3.15.8
  • libstdcxx-ng 9.3.0
  • libtasn1 4.16.0
  • libtiff 4.2.0
  • libunistring 0.9.10
  • libuuid 1.0.3
  • libuv 1.40.0
  • libwebp 1.2.0
  • libwebp-base 1.2.0
  • libxcb 1.14
  • libxml2 2.9.12
  • lz4-c 1.9.3
  • markdown 3.3.6
  • matplotlib 3.5.0
  • matplotlib-base 3.5.0
  • mkl 2021.4.0
  • mkl-service 2.4.0
  • mkl_fft 1.3.1
  • mkl_random 1.2.2
  • multidict 5.2.0
  • munkres 1.1.4
  • ncurses 6.3
  • nettle 3.7.3
  • numexpr 2.8.1
  • numpy 1.21.2
  • numpy-base 1.21.2
  • oauthlib 3.2.0
  • olefile 0.46
  • openh264 2.1.1
  • openssl 1.1.1m
  • packaging 21.3
  • pandas 1.3.4
  • pcre 8.45
  • pillow 8.4.0
  • pip 21.2.2
  • protobuf 3.15.8
  • pyasn1 0.4.8
  • pyasn1-modules 0.2.7
  • pycparser 2.21
  • pydeprecate 0.3.2
  • pyjwt 2.3.0
  • pyopenssl 22.0.0
  • pyparsing 3.0.7
  • pyqt 5.9.2
  • pysocks 1.7.1
  • python 3.7.11
  • python-dateutil 2.8.2
  • python_abi 3.7
  • pytorch 1.10.2
  • pytorch-lightning 1.5.10
  • pytorch-mutex 1.0
  • pytz 2021.3
  • pyu2f 0.1.5
  • pyyaml 5.4.1
  • qt 5.9.7
  • readline 8.1.2
  • requests 2.27.1
  • requests-oauthlib 1.3.1
  • rsa 4.8
  • scipy 1.7.3
  • setuptools 58.0.4
  • sip 4.19.8
  • six 1.16.0
  • sqlite 3.37.2
  • tensorboard 2.8.0
  • tensorboard-data-server 0.6.0
  • tensorboard-plugin-wit 1.8.1
  • tk 8.6.11
  • torchaudio 0.10.2
  • torchmetrics 0.7.2
  • torchvision 0.11.3
  • tornado 6.1
  • tqdm 4.62.3
  • typing-extensions 3.10.0.2
  • typing_extensions 3.10.0.2
  • urllib3 1.26.8
  • werkzeug 2.0.3
  • wheel 0.37.1
  • xz 5.2.5
  • yaml 0.2.5
  • yarl 1.6.3
  • zipp 3.7.0
  • zlib 1.2.11
  • zstd 1.4.9