I refer to the above example. I used the below code and got the following outputs:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
start_scope()
# Parameters
num_inputs = 100
input_rate = 10*Hz
# Parameters from STDP function
taupre = taupost = 20*ms
wmax = 0.01
Apre = 0.01
Apost = -Apre*1.05
# Time constant
tau = 1*ms
# Construct the poisson neurons
P = PoissonGroup(num_inputs, rates=input_rate)
eqs = '''
dv/dt = -v/tau : 1
'''
# Construct the output neuron
G = NeuronGroup(1, eqs, threshold='v>0.04', reset='v=0', method='exact')
# Define the synapses
S = Synapses(P, G,
'''
w: 1
dapre/dt = -apre/taupre : 1 (event-driven)
dapost/dt = -apost/taupost : 1 (event-driven)
''',
on_pre='''
v_post += w
apre += Apre
w = clip(w+apost, 0, wmax)
''',
on_post='''
apost += Apost
w = clip(w+apre, 0, wmax)
''', method='linear')
S.connect()
# Initialise the weights of the synapses
S.w = 0.01
# State monitor for synapses
M = StateMonitor(S,['w', 'apre', 'apost'], record=True)
# State monitor for output neuron
F = StateMonitor(G,'v',record=True)
# Run simulation for 2 second
run(2*second)
--------------------------------------------------------------------------------------------------------------------------------------------------------
Is this really the correct way to do this? Do the weights really represent the conductances or no? Someone please enlighten me on this. Thanks!