GithubHelp home page GithubHelp logo

mohitsaxenaknoldus / spikenetopt.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from russelljjarvis/spikingneuralnetworks_.jl

0.0 0.0 0.0 1.5 MB

Julia has enough tools to support fitting spiking neural network models to data. Python speed necessitates external simulators to do network simulation. As much as possible it would be nice to do fast, efficient data fitting of spike trains to network models in one language, lets try to do that here.

License: MIT License

Julia 96.47% Dockerfile 3.53%

spikenetopt.jl's Introduction

Spiking Network Examples in Julia

All Contributors GitHub issues GitHub closed issues GitHub pull requests GitHub commit activity

Description

Julia has enough tools to support fitting spiking neural network models to data. Python speed necessitates external simulators to do network simulation. As much as possible it would be nice to do fast, efficient data fitting of spike trains to network models in one language, lets try to do that here.

Getting Started

Install the Julia module

This is not yet an official package, so the package would need to be added in developer mode. The short way to do this is as follows:

Pkg.add(url="https://github.com/russelljjarvis/SpikeNetOpt.jl.git")

The long way:

git clone https://github.com/russelljjarvis/SpikeNetOpt.jl
cd SpikeNetOpt.jl
julia
]
(@v1.5) pkg> develop .

Or

Pkg.develop(PackageSpec(path=pwd()))

Entry Points

Optimize a spiking neural network by exploring effect of parameter that controls connectome graph structure:

julia
include("examples/run_net_opt.jl")

cd examples
julia run_net_opt.jl

Single cell data fitting against spike times:

cd test
julia single_cell_opt_adexp.jl
julia single_cell_opt_izhi.jl

Motivation

Previous work in data-driven optimization of spiking neurons was implemented in Python. The Python implementation of reduced model simulation sometimes called external simulation, and overall my previous implementation of reduced model optimization was slower and more complex than it needed to be, for language and tool specific reasons.

Reduced model spiking neurons models have compact equations, and they should be fast to simulate, but Python often calls external codes and programes (C,C++,NEURON,brian2,NEST,PyNN) to achieve a speedup for network simulations, however, approaches for speeding up network simulations are not necessarily efficient or convenient for running single-cell simulations, as me be required for single cell optimizations. This strategy of calling external code causes an intolerable code complexity and intolerable run-time cost for single neuron simulations. The Python tool numba JIT partially remedies this problem, however, code from the Python optimization framework DEAP/BluePyOpt also induces an additional overhead. An almost pure Julia SNN optimization routine is a better solution to efficiently optimizing Reduced SNN models. In this package, two other packages: Evolutionary.jl, and Metaheuristics provide genetic algorithms used to optimize spiking neural networks.

Other Info

A Google Doc presentation that sets up the motivation for the project. Part of BrainHack

Optimization Outputs

The loss function is constructed by computing Spike Distance between all pairs of neurons Networks are optimized using pair wise spike-distance metric on each pair of neurons Pythons NetworkUnit package is used to perform a posthoc evaluation of the optimized network.

Example Outputs

See the figure below where local variation and firing rates are compared against every neuron between two model networks.

Network optimization

For example this is a ground truth model versus an optimized model t-test of firing rates:

Student's t-test
	datasize: 200 	 200
	t = 11.811 	 p value = 1.82e-25

Single Cell optimization

Note for perspective 86% of spike times are matched in some of the best, model fitting competitions. Output from a single cell optimization: https://github.com/russelljjarvis/SpikeNetOpt.jl/blob/main/img/single_cell_spike_time_fit.png Output from a Network Spike Time optimization (note that Unicode backend is the plotting method, and neuron synapses fire propabilistically):

https://github.com/russelljjarvis/SpikeNetOpt.jl/blob/main/img/net_compare_unicode.png

Development Plans

DONE

  • Used spike distance and genetic algorithms to optimize network spike raster activity.
  • Used pythons NetworkUnit to validate results and t-tests of results
  • Created single cell model fitting to Allen Brain Observatory Spike Train Data.

TODO

  • Ability to toggle between simulator backends (AStupid bear vs https://github.com/darsnack/SpikingNN.jl,WaspNet.jl,SpikingNN.jl)
  • Implemented multi-processing of feature extraction/spike distance (sort of)
  • Animation of Genetic Algorithm Convergence (sort of)
  • Multiprocessing as opposed to multi-threading
  • NeuroEvolution
  • ADAM-Opt predictions using evolved population.
  • Read in and optimize against FPGA Event Stream Data AEDAT

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Russell Jarvis

๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐ŸŽจ ๐Ÿš‡

This project follows the all-contributors specification. Contributions of any kind welcome!

Current Design Flow Chart:

https://github.com/russelljjarvis/SpikeNetOpt.jl/blob/main/doc/Flowchart%20(2).jpg

Intended Future Design:

spikenetopt.jl's People

Contributors

russelljjarvis avatar allcontributors[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.