Optimal spatiotemporal spike pattern detection by STDP (Masquelier 2017)

 Download zip file 
Help downloading and running models
We simulate a LIF neuron equipped with STDP. A pattern repeats in its inputs. The LIF progressively becomes selective to the repeating pattern, in an optimal manner.
1 . Masquelier T (2018) STDP Allows Close-to-Optimal Spatiotemporal Spike Pattern Detection by Single Coincidence Detector Neurons. Neuroscience 389:133-140 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Neuron or other electrically excitable cell;
Brain Region(s)/Organism:
Cell Type(s): Abstract integrate-and-fire leaky neuron;
Gap Junctions:
Simulation Environment: MATLAB;
Model Concept(s): Coincidence Detection; STDP; Unsupervised Learning; Hebbian plasticity; Long-term Synaptic Plasticity; Pattern Recognition; Spatio-temporal Activity Patterns;
Implementer(s): Masquelier, Tim [timothee.masquelier at alum.mit.edu];
# This code was used in: Masquelier T (2017) STDP allows close-to-optimal spatiotemporal spike pattern detection by single coincidence detector neurons. Neuroscience.
# https://doi.org/10.1016/j.neuroscience.2017.06.032
# Jan 2017
# timothee.masquelier@cnrs.fr
# This is a Python script to launch several threads of main.m (with different random seeds). This is useful if multiple cores are available.
# For example batch.py -i 0 -f 8 -s 1 will launch 8 threads, each thread will save its results in ../data/
# A priori, you want to remove all mat files in ../data/ before launching this batch.

import subprocess
from numpy import *
import sys
import getopt

    opts, args = getopt.getopt(sys.argv[1:], 'i:f:s:', ['initial=', 'final=','step='])
except getopt.GetoptError, err:
    # print help information and exit:
    print str(err) # will print something like "option -a not recognized"
#    usage()
#opts, extraparams = getopt.getopt(sys.argv[1:],'r:w:',['randomSeed='])
# starts at the second element of argv since the first one is the script name
# extraparms are extra arguments passed after all option/keywords are assigned
# opts is a list containing the pair "option"/"value"
for o,p in opts:
  if o in ['-i','--initial']:
     initial = double(p)
  elif o in ['-f','--final']:
     final = double(p)
  elif o in ['-s','--step']:
     step = double(p)

import multiprocessing
import subprocess

def calculate(alpha):
    subprocess.call('matlab -singleCompThread -nojvm -nosplash -nodesktop -r  "seed='+ str(alpha) +';main "; ',shell=True)

if __name__ == '__main__':
    pool = multiprocessing.Pool(None)
    # pool = multiprocessing.Pool(4)
    tasks = arange(initial,final,step)
    results = []
    r = pool.map_async(calculate, tasks, callback=results.append)
    r.wait() # Wait on the results
    print results

Loading data, please wait...