#!pip install ANNarchy
Adaptive Exponential IF neuron
This notebook explores how the AdEx neuron model can reproduce various spiking patterns observed in vivo.
Code based on:
Naud, R., Marcille, N., Clopath, C., and Gerstner, W. (2008). Firing patterns in the adaptive exponential integrate-and-fire model. Biol Cybern 99, 335. doi:10.1007/s00422-008-0264-7.
import ANNarchy as ann
ANNarchy 5.0 (5.0.0) on darwin (posix).
The AdEx neuron is defined by the following equations:
C \, \frac{dv}{dt} = -g_L \ (v - E_L) + g_L \, \Delta_T \, \exp(\frac{v - v_T}{\Delta_T}) + I - w
\tau_w \, \frac{dw}{dt} = a \, (v - E_L) - w
if v > v_\text{spike}:
- v = v_R
- w = w + b
= ann.Neuron(
AdEx =dict(
parameters= ann.Parameter(200.),
C = ann.Parameter(10.), # not g_L! g_ is reserved for spike transmission
gL = ann.Parameter(-70.),
E_L = ann.Parameter(-50.),
v_T = ann.Parameter(2.0),
delta_T = ann.Parameter(2.0),
a = ann.Parameter(30.),
tau_w = ann.Parameter(0.),
b = ann.Parameter(-58.),
v_r = ann.Parameter(500.),
I = ann.Parameter(0.0),
v_spike
),= [
equations'C * dv/dt = - gL * (v - E_L) + gL * delta_T * exp((v-v_T)/delta_T) + I - w', init=-70.0),
ann.Variable('tau_w * dw/dt = a * (v - E_L) - w'),
ann.Variable(
],= "v >= v_spike",
spike = """
reset v = v_r
w += b
""",
= 2.0
refractory )
We create a population of 8 AdEx neurons which will get different parameter values.
= ann.Network(dt=0.1)
net = net.create(8, AdEx)
pop compile() net.
Compiling network 1... OK
We add a monitor to track the membrane potential and the spike timings during the simulation.
= net.monitor(pop, ['v', 'spike']) m
As in the paper, we provide different parameters to each neuron and simulate the network for 500 ms with a fixed input current, and remove that current for an additional 50 ms.
# a) tonic spiking b) adaptation, c) initial burst, d) regular bursting, e) delayed accelerating, f) delayed regular bursting, g) transcient spiking, h) irregular spiking
= [200, 200, 130, 200, 200, 200, 100, 100]
pop.C = [ 10, 12, 18, 10, 12, 12, 10, 12]
pop.gL = [-70, -70, -58, -58, -70, -70, -65, -60]
pop.E_L = [-50, -50, -50, -50, -50, -50, -50, -50]
pop.v_T = [ 2, 2, 2, 2, 2, 2, 2, 2]
pop.delta_T = [ 2, 2, 4, 2,-10., -6.,-10.,-11.]
pop.a = [ 30, 300, 150, 120, 300, 300, 90, 130]
pop.tau_w = [ 0, 60, 120, 100, 0, 0, 30, 30]
pop.b = [-58, -58, -50, -46, -58, -58, -47, -48]
pop.v_r = [500, 500, 400, 210, 300, 110, 350, 160]
pop.I
# Reset neuron
= pop.E_L
pop.v = 0.0
pop.w
# Simulate
500.)
net.simulate(= 0.0
pop.I 50.)
net.simulate(
# Recordings
= m.get('v')
data = m.get('spike')
spikes for n, t in spikes.items(): # Normalize the spikes
- m.times()['v']['start'][0] for x in t], n] = 0.0 data[[x
We can now visualize the simulations:
import matplotlib.pyplot as plt
= [
titles "a) tonic spiking",
"b) adaptation",
"c) initial burst",
"d) regular bursting",
"e) delayed accelerating",
"f) delayed regular bursting",
"g) transcient spiking",
"h) irregular spiking"
]
=(12, 15))
plt.figure(figsize-70., 0.))
plt.ylim((for i in range(8):
4, 2, i+1)
plt.subplot(
plt.title(titles[i])=3)
plt.plot(data[:, i], lw
plt.tight_layout() plt.show()