Hi all,
I am trying to replicate the example in
https://brian2.readthedocs.io/en/stable/examples/synapses.STDP.html. This time round, I am using my own units.
For instance I have A+ = 107.84 % and A- = -45.36 % (It is in percentage). My STDP fitted values are % change plotted against delta t. I made the following changes with no. of Poisson neurons
as 100 instead of 1000. However after running the below code, all my final conductances reached the maximum value. Something is wrong over here? Has it got to do with the magnitude or whatever? Please
help and thanks!!
---------------------------------------------------------------------------- CODE ------------------------------------------------------------------------------------------------------
from brian2 import *
start_scope()
N = 100 # Original N is 1000
taum = 64*ms
taupre = 127*ms
taupost = taupre
Ee = 0*mV
vt = -0.5*mV
vr = -0.5*mV
El = -0*mV
taue = 32*ms
F = 15*Hz # Original F is 15
gmax = 140e-6 # Maximum conductance
dApre = 1.0784
dApost = -0.4536
dApost *= gmax
dApre *= gmax
eqs_neurons = '''
dv/dt = (ge * (Ee-vr) + 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='exact')
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'
#print(S.w)
mon = StateMonitor(S, 'w', record=[0, 1])
###############################
M = StateMonitor(neurons,'v',record=True) # Monitor the potential of the neuron
###############################
s_mon = SpikeMonitor(input)
run(100*second, report='text') # Original 100 second
subplot(311)
plot(S.w / gmax, '.k')
ylabel('Weight / gmax')
xlabel('Synapse index')
subplot(312)
hist(S.w / gmax, 20)
xlabel('Weight / gmax')
subplot(313)
plot(mon.t/second, mon.w.T/gmax)
xlabel('Time (s)')
ylabel('Weight / gmax')
tight_layout()
show()
#print(S.w)
--------------------------------------------------------- OUTPUT ---------------------------------------------------------------