Reward modulated STDP (Legenstein et al. 2008)

 Download zip file 
Help downloading and running models
Accession:116837
"... This article provides tools for an analytic treatment of reward-modulated STDP, which allows us to predict under which conditions reward-modulated STDP will achieve a desired learning effect. These analytical results imply that neurons can learn through reward-modulated STDP to classify not only spatial but also temporal firing patterns of presynaptic neurons. They also can learn to respond to specific presynaptic firing patterns with particular spike patterns. Finally, the resulting learning theory predicts that even difficult credit-assignment problems, where it is very hard to tell which synaptic weights should be modified in order to increase the global reward for the system, can be solved in a self-organizing manner through reward-modulated STDP. This yields an explanation for a fundamental experimental result on biofeedback in monkeys by Fetz and Baker. In this experiment monkeys were rewarded for increasing the firing rate of a particular neuron in the cortex and were able to solve this extremely difficult credit assignment problem. ... In addition our model demonstrates that reward-modulated STDP can be applied to all synapses in a large recurrent neural network without endangering the stability of the network dynamics."
Reference:
1 . Legenstein R, Pecevski D, Maass W (2008) A learning theory for reward-modulated spike-timing-dependent plasticity with application to biofeedback. PLoS Comput Biol 4:e1000180 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Neocortex;
Cell Type(s):
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: Python; PCSIM;
Model Concept(s): Pattern Recognition; Spatio-temporal Activity Patterns; Reinforcement Learning; STDP; Biofeedback; Reward-modulated STDP;
Implementer(s):
import os, sys
import matplotlib
matplotlib.use('Agg')


from pypcsim import *
import pypcsimplus as pcsim
from numpy import *
import random, getopt
import numpy
from datetime import datetime
from math import *
from tables import *
from math import exp
from mpi4py import MPI
import LiquidModel400 as Liq
import SpeechStimulusInputModel as Inp
from traceback import *

class Liquid400Experiment(pcsim.Experiment):
            
    def defaultExpParameters(self):
        ep = self.expParams 
        
        # General simulation parameters
                
        ep.DTsim = 1e-4
        
        ep.trialT = 2.5
        
        # Network distribution parameters
        ep.netType = 'MT'
        ep.nThreads = 2
        ep.minDelay = 1e-3
        ep.maxDelay = 2   
        
        # Seeds of the experiment
        ep.numpyRandomSeed = 31342
        ep.pyRandomSeed = 124243        
        ep.constructionSeed = 3224356
        ep.simulationSeed = 134252439
        
        ep.runMode = "long"        
        ep.liquid = "Liq.LiquidModel400"        
        ep.input = "Inp.SpeechStimulusInputModel"  
        
        ep.ipEngineID = 0
        
    def setupModels(self):        
        p = self.modelParams
        ep = self.expParams
        m = self.models
        net = self.net
        ep.Tsim = ep.trialT        
        
        random.seed(ep.pyRandomSeed)        
        numpy.random.seed(int(ep.numpyRandomSeed))
                                     
        m.liquid = eval(ep.liquid + '(self.net, self.expParams, p.get("liquid",{}))')
                
        m.input = eval(ep.input + '(self.net, self.expParams, p.get("input",{}), depModels = m.liquid)')        
        
        ep.samplingTime = int(ep.Tsim / (200 * ep.DTsim))
        
        m.liquid.generate()                    
        m.input.generate()
                    
    def reset(self):
        self.net.reset()
        
    def setupRecordings(self):
        r = self.recordings        
        r.input = self.models.input.setupRecordings()
        r.liquid = self.models.liquid.setupRecordings()    
        return r

    def getOutput(self):
        out = pcsim.Dictionary()
        r = self.recordings
        net = self.net
        out.exc_spikes = [ array(r.liquid.exc_spikes.object(i).getRecordedValues()) for i in range(r.liquid.exc_spikes.size()) ]
        out.inh_spikes = [ array(r.liquid.inh_spikes.object(i).getRecordedValues()) for i in range(r.liquid.inh_spikes.size()) ]
        out.numSynapses = [r.liquid.numSynapses]
        
        input = [ array(r.input.input.object(i).getRecordedValues()) for i in range(r.input.input.size()) ]
        return out,input
        
    
    def simulate(self):
        ep = self.expParams
        ep.samplingTime = int(ep.Tsim / (200 * ep.DTsim))
        ep.Tsim = ep.trialT
        
        t0=datetime.today()
        self.net.advance(int(ep.Tsim/ep.DTsim))                            
        t1=datetime.today()
        print 'Done.', (t1-t0).seconds, 'sec CPU time for', ep.Tsim, 's simulation time';        
        self.expParams.simDuration = (t1 - t0).seconds
        
        
    def scriptList(self):
        return ["Liquid400Experiment.py"]
 
if __name__ == "__main__":
    exper = Liquid400Experiment('test', experParams = {})
    exper.setup()
    exper.models.input.resetStimulus((1,1,1))
    exper.run('shortrun', saveData = False)
    print exper.getOutput()

Loading data, please wait...