 # Description of problem

I tried one pair of neurons based on the STDP example with minor modifications on gmax and S.delay. The number of pre-synaptic neuron spikes is smaller than the number of post synaptic spikes. Since there’s only one pre-synaptic and one post-synaptic neuron, I would expect the opposite. Any hints would be appreciated.

# Minimal code to reproduce problem

from brian2 import *
seed(1234567890)
#set_device(‘cpp_standalone’, directory=‘STDP_standalone’)

N = 1
taum = 10ms
taupre = 20
ms
taupost = taupre
Ee = 0mV
vt = -54
mV
vr = -60mV
El = -74
mV
taue = 5ms
F = 15
Hz
gmax = 1.5
dApre = .01
dApost = -dApre * taupre / taupost * 1.05
dApost *= gmax
dApre *= gmax

eqs_neurons = ‘’’
dv/dt = (ge * (Ee-v) + El - v) / taum : volt
dge/dt = -ge / taue : 1
‘’’

input = PoissonGroup(N, rates=F)
neurons = NeuronGroup(1, eqs_neurons, threshold=‘v>vt’, reset=‘v = vr’,
method=‘euler’)
S = Synapses(input, neurons,
‘’‘w : 1
dApre/dt = -Apre / taupre : 1 (event-driven)
dApost/dt = -Apost / taupost : 1 (event-driven)’’’,
on_pre=’’‘ge += w
Apre += dApre
w = clip(w + Apost, 0, gmax)’’’,
on_post=’’‘Apost += dApost
w = clip(w + Apre, 0, gmax)’’’,
)
S.connect()
S.w = ‘rand() * gmax’
S.delay = ‘rand()100ms’
mon = StateMonitor(S, ‘w’, record=[0, 1])
in_mon = SpikeMonitor(input)
s_mon = SpikeMonitor(neurons)

run(10*second, report=‘text’)

print(" num of input spikes: “, in_mon.num_spikes, " neuron spikes:”, s_mon.num_spikes)

# Expected output (if relevant)

num of input spikes: 156 neuron spikes: 248

Sorry to spam the list. It’s apparently due to the slow decay of ge. When neuron reset the spikes, the ge is still large enough to cause a consecutive spike by itself.

This makes sense. You might want to add a refractory period to the cell to avoid this kind of “bursting” behaviour. Also note that it is a bit of an artificial issue, since you have a single input neuron spiking at a low rate and you therefore need an extremely strong synapse to make your target neuron spike.

1 Like