#!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
ann.clear()=0.1) ann.setup(dt
ANNarchy 4.8 (4.8.2) 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 ="""
parameters C = 200.
gL = 10. # not g_L! g_ is reserved for spike transmission
E_L = -70.
v_T = -50.
delta_T = 2.0
a = 2.0
tau_w = 30.
b = 0.
v_r = -58.
I = 500.
v_spike = 0.0
""",
="""
equations C * dv/dt = - gL * (v - E_L) + gL * delta_T * exp((v-v_T)/delta_T) + I - w : init=-70.0
tau_w * dw/dt = a * (v - E_L) - w : init=0.0
""",
="""
spike v >= v_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.Population(8, AdEx) pop
compile() ann.
Compiling ... OK
We add a monitor to track the membrane potential and the spike timings during the simulation.
= ann.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.)
ann.simulate(= 0.0
pop.I 50.)
ann.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()