#!pip install ANNarchy
Short-term Plasticity and Synchrony
Implementation of the recurrent network with short-term plasticity (STP) proposed in:
Tsodyks, Uziel and Markram (2000). Synchrony Generation in Recurrent Networks with Frequency-Dependent Synapses, The Journal of Neuroscience, 20(50).
import numpy as np
import matplotlib.pyplot as plt
import ANNarchy as ann
ANNarchy 5.0 (5.0.0) on darwin (posix).
This network uses simple leaky integrate-and-fire (LIF) neurons:
= ann.Neuron(
LIF = dict(
parameters = 30.0,
tau = ann.Parameter(15.0),
I = 3.0,
tau_I
),= [
equations 'tau * dv/dt = -v + g_exc - g_inh + I', init=13.5),
ann.Variable('tau_I * dg_exc/dt = -g_exc'),
ann.Variable('tau_I * dg_inh/dt = -g_inh'),
ann.Variable(
],= "v > 15.0",
spike = "v = 13.5",
reset = 3.0
refractory
)
= ann.Network(dt=0.25)
net
= net.create(geometry=500, neuron=LIF)
P = np.sort(ann.Uniform(14.625, 15.375).get_values(500))
P.I = ann.Uniform(0.0, 15.0)
P.v = P[:400]
Exc = P[400:] Inh
Short-term plasticity can be defined by dynamical changes of synaptic efficiency, based on pre- or post-synaptic activity.
We define a STP synapse, whose post-pynaptic potential (psp, define by g_target
) depends not only on the weight w
and the emission of pre-synaptic spike, but also on intra-synaptic variables x
and u
:
= ann.Synapse(
STP = dict(
parameters = ann.Parameter(1.0),
tau_rec = ann.Parameter(1.0),
tau_facil = ann.Parameter(0.1),
U
),= [
equations 'dx/dt = (1 - x)/tau_rec', init = 1.0, method='event-driven'),
ann.Variable('du/dt = (U - u)/tau_facil', init = 0.1, method='event-driven'),
ann.Variable(
],="""
pre_spike g_target += w * u * x
x *= (1 - u)
u += U * (1 - u)
"""
)
Creating the projection between the excitatory and inhibitory is straightforward when the right parameters are chosen:
# Parameters for the synapses
= 1.8
Aee = 5.4
Aei = 7.2
Aie = 7.2
Aii
= 0.5
Uee = 0.5
Uei = 0.04
Uie = 0.04
Uii
= 800.0
tau_rec_ee = 800.0
tau_rec_ei = 100.0
tau_rec_ie = 100.0
tau_rec_ii
= 1000.0
tau_facil_ie = 1000.0
tau_facil_ii
# Create projections
= net.connect(pre=Exc, post=Exc, target='exc', synapse=STP)
proj_ee =0.1, weights=ann.Normal(Aee, (Aee/2.0), min=0.2*Aee, max=2.0*Aee))
proj_ee.fixed_probability(probability= ann.Normal(Uee, (Uee/2.0), min=0.1, max=0.9)
proj_ee.U = ann.Normal(tau_rec_ee, (tau_rec_ee/2.0), min=5.0)
proj_ee.tau_rec = net.dt # Cannot be 0!
proj_ee.tau_facil
= net.connect(pre=Inh, post=Exc, target='inh', synapse=STP)
proj_ei =0.1, weights=ann.Normal(Aei, (Aei/2.0), min=0.2*Aei, max=2.0*Aei))
proj_ei.fixed_probability(probability= ann.Normal(Uei, (Uei/2.0), min=0.1, max=0.9)
proj_ei.U = ann.Normal(tau_rec_ei, (tau_rec_ei/2.0), min=5.0)
proj_ei.tau_rec = net.dt # Cannot be 0!
proj_ei.tau_facil
= net.connect(pre=Exc, post=Inh, target='exc', synapse=STP)
proj_ie =0.1, weights=ann.Normal(Aie, (Aie/2.0), min=0.2*Aie, max=2.0*Aie))
proj_ie.fixed_probability(probability= ann.Normal(Uie, (Uie/2.0), min=0.001, max=0.07)
proj_ie.U = ann.Normal(tau_rec_ie, (tau_rec_ie/2.0), min=5.0)
proj_ie.tau_rec = ann.Normal(tau_facil_ie, (tau_facil_ie/2.0), min=5.0)
proj_ie.tau_facil
= net.connect(pre=Inh, post=Inh, target='inh', synapse=STP)
proj_ii =0.1, weights=ann.Normal(Aii, (Aii/2.0), min=0.2*Aii, max=2.0*Aii))
proj_ii.fixed_probability(probability= ann.Normal(Uii, (Uii/2.0), min=0.001, max=0.07)
proj_ii.U = ann.Normal(tau_rec_ii, (tau_rec_ii/2.0), min=5.0)
proj_ii.tau_rec = ann.Normal(tau_facil_ii, (tau_facil_ii/2.0), min=5.0) proj_ii.tau_facil
We compile and simulate for 10 seconds:
# Compile
compile()
net.
# Record
= net.monitor(Exc, 'spike')
Me = net.monitor(Inh, 'spike')
Mi
# Simulate
= 10000.0
duration =True) net.simulate(duration, measure_time
Compiling network 1... OK
Simulating 10.0 seconds of the network 1 took 0.07660222053527832 seconds.
We retrieve the recordings and plot them:
# Retrieve recordings
= Me.get()
data_exc = Mi.get()
data_inh = Me.raster_plot(data_exc['spike'])
te, ne = Mi.raster_plot(data_inh['spike'])
ti, ni
# Histogram of the exc population
= Me.histogram(data_exc['spike'], bins=1.0)
h
# Mean firing rate of each excitatory neuron
= []
rates for neur in data_exc['spike'].keys():
len(data_exc['spike'][neur])/duration*1000.0) rates.append(
=(12, 10))
plt.figure(figsize3,1,1)
plt.subplot('b.', markersize=1.0)
plt.plot(te, ne, 'b.', markersize=1.0)
plt.plot(ti, ni, 0, duration)); plt.ylim((0,500))
plt.xlim(('Time (ms)')
plt.xlabel('# neuron')
plt.ylabel(
3,1,2)
plt.subplot(/400.)
plt.plot(h'Time (ms)')
plt.xlabel('Net activity')
plt.ylabel(
3,1,3)
plt.subplot(sorted(rates))
plt.plot('Spikes / sec')
plt.ylabel('# neuron')
plt.xlabel( plt.show()