Coder Social home page Coder Social logo

braindynamicsusyd / spikegrid Goto Github PK

View Code? Open in Web Editor NEW
1.0 12.0 4.0 178.54 MB

Spiking neural circuit models developed in Dr. Pulin Gong's group at University of Sydney

Python 6.16% M 0.01% F# 0.50% MATLAB 1.19% Makefile 2.76% Shell 11.18% C 7.07% C++ 67.21% CMake 0.60% M4 0.62% Objective-C 2.69%

spikegrid's Introduction

spikegrid

#Dependencies

  1. OpenCV - used for visualization and some output - this can be disabled in the makefile, but many features will be lost. OpenCV 2.X.X is best and is the version that most linux distros seem to be packaging. OpenCV 3 can also be used, but some of the paths for the include files are different
  2. Newish version of GCC - needs to support c++11 for c++ and gnu11 for C. See here for how to access it at physics https://github.com/BrainDynamicsUSYD/neurofield/wiki/Getting-GCC-in-Physics
  3. inotify-tools - for make watch (build as soon as a file is changed)

Following the instructions for setting up GCC should also pull in a version of openCV that I have compiled.

Note: compiling openCV will also require CMake - but most systems will come with it preinstalled

Other Note: doing CC=Clang CXX=clang make will compile the code with clang (if installed). This can be useful as clang will warn on different things to GCC. I would like to reduce the very large number of warnings this generates. The clang build is secondary though and the primary compiler is still gcc.

#Documentation Some developer documentation can be auto-generated from the code using Doxygen with the following command: make docs

other documentation is available in the wiki here: https://github.com/BrainDynamicsUSYD/spikegrid/wiki

#Long term code cleanup tasks:

Things that need to be done:

  1. In some places, we might need to use size_t for things which are indexes in arrays. There are at least a few places where we have assumed that unsigned int or int are sufficiently large. For large grids with STDP / random connections, this may not actually be true.
  2. Many of the parameters are not used and/or not currently working - there should be a real project to make sure we have a test case for each option and that it can be easily tested.

spikegrid's People

Contributors

bmunn avatar clubkeano avatar jpalmer avatar pulingong01 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spikegrid's Issues

Compiling doesn't work on macs

So in theory it should be possible to compile the code on a mac.

There are some issues:

  1. the mac uses clang instead of gcc (and it is clang that tries really hard to pretend to be gcc).

  2. how to get the dependencies working.

  3. is basically solved as we can use clang on linux

  4. is more difficult - but should be possible through homebrew

Rerunnable code in matlab

Summary

At the moment, if you try and restart the code within matlab - for example running run_model twice, matlab will segfault.

The segfault is caused by an issue with the arguments to the first call but this isn't the real problem - we need a way to call the init functions again.

The problem is that we only have a single entry point from matlab which does make things a little more difficult.

detail

the code in the run_model script
does something like:

[V,outputs]=conductance('dummy',output);

this is because we don't know how big the voltage array needs to be
(on the matlab side).

So then in the C code, since the setup has been called, it tries to
use dummy as an input voltage matrix which obviously fails.

My suggestion: in mexfunction in src/conductance.c add some check on
the input arguments and then use that to set setup_done to 0 -
basically you want to do:

if input[0]=='dummy' then setup_done=0

obviously, not quite this simple, but that is the rough idea

Brandon is currently working on this

Documentation

So currently the documentation is pretty poor.

I think we need two types of documentation.

  1. The wiki - the output stuff is already pretty well specified (although some info on the actual things you can output would be good). It would be good to get some more of this type of high level stuff. I think basically the wiki articles should be mainly for people who are only modifying the config file.
  2. Comments/doxygen Some of this is done but more would be good. This should provide some more detailed information than the wiki, for people who are actually modifying the code.

Latest code is broken

My T-maze sims are very broken in the current versions.

Some serious proper debugging is required.

At the moment I wouldn't trust the results of anything which is using STDP

STDP implementation can be simpler

If anyone wants to do this, the STDP implementation can be simplified.

The idea is similar to what is described in Synaptic plasticity: taming the beast (review article in nature neuroscience). Also similar to the approach to splitting off the R/D variables

Basically, rather than using the lagstorage.c class, we store one new number per neuron.

On each timestep this is multiplied by a constant $C<1$. this depends on the tau in STDP.

On each spike, it is incremented by $A$ which is the same A as in the STDP window function.

Then when another neuron spikes, we just use this value to change the synaptic strengths.

This approach will remove a pretty significant part of the complexity of the calculation.

What can be easily removed/simplified if this is done:

src/lagstorage.*
stdp_change_calc (simplified)

DoSTDP also probably becomes simpler.

The other changes are that STDP_data uses the lags member and gets a different, simpler array instead.

Also, this will use less memory than before - (we go from a lagstorage/neuron to a float/neuron) so is faster because of that

also, the updates in lagstorage.c branch quite unpredictably so it should be faster to change to this new method

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.