#!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 ANNarchy as ann
ann.clear()
=0.25
dt=dt) ann.setup(dt
ANNarchy 4.8 (4.8.2) on darwin (posix).
This network uses simple leaky integrate-and-fire (LIF) neurons:
= ann.Neuron(
LIF = """
parameters tau = 30.0 : population
I = 15.0
tau_I = 3.0 : population
""",
= """
equations tau * dv/dt = -v + g_exc - g_inh + I : init=13.5
tau_I * dg_exc/dt = -g_exc
tau_I * dg_inh/dt = -g_inh
""",
= "v > 15.0",
spike = "v = 13.5",
reset = 3.0
refractory
)
= ann.Population(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 = """
parameters tau_rec = 1.0
tau_facil = 1.0
U = 0.1
""",
= """
equations dx/dt = (1 - x)/tau_rec : init = 1.0, event-driven
du/dt = (U - u)/tau_facil : init = 0.1, event-driven
""",
="""
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
= ann.Projection(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.connect_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 = dt # Cannot be 0!
proj_ee.tau_facil
= ann.Projection(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.connect_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 = dt # Cannot be 0!
proj_ei.tau_facil
= ann.Projection(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.connect_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
= ann.Projection(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.connect_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()
ann.
# Record
= ann.Monitor(Exc, 'spike')
Me = ann.Monitor(Inh, 'spike')
Mi
# Simulate
= 10000.0
duration =True) ann.simulate(duration, measure_time
Compiling ... OK
Simulating 10.0 seconds of the network took 0.07543301582336426 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(
import matplotlib.pyplot as plt
=(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()