#!pip install ANNarchy
Synaptic transmission
This notebook simply demonstrates the three main type of synaptic transmission for spiking neurons:
- Instantaneous
- Exponentially-decreasing
- Alpha-shaped
import numpy as np
import matplotlib.pyplot as plt
import ANNarchy as ann
ANNarchy 5.0 (5.0.0) on darwin (posix).
We use here a simple LIF neuron receving three types of projections (a, b, c). The conductance g_a
uses instantaneous transmission, as it is reset to 0 after each step. g_b
decreases exponentially with time following a first order ODE. g_c
is integrated twice in alpha_c
, leading to the alpha shape.
All methods use the exponential numerical method, as they are first order linear ODEs and can be solved exactly.
= ann.Neuron(
LIF = dict(
parameters = 20.,
tau = -70.,
E_L = 0.,
v_T = -58.,
v_r = 10.0,
tau_b = 10.0,
tau_c
),= [
equations # Membrane potential
'tau * dv/dt = (E_L - v) + g_a + g_b + alpha_c', init=-70.),
ann.Variable(
# Exponentially decreasing
'tau_b * dg_b/dt = -g_b', method='exponential'),
ann.Variable(
# Alpha-shaped
'tau_c * dg_c/dt = -g_c', method='exponential'),
ann.Variable('tau_c * dalpha_c/dt = exp((tau_c - dt/2.0)/tau_c) * g_c - alpha_c', method='exponential'),
ann.Variable(
],="v >= v_T",
spike="v = v_r",
reset= 2.0
refractory )
The LIF neuron will receive a single spike at t = 10 ms, using the SpikeSourceArray
specific population.
= ann.Network()
net = net.create(ann.SpikeSourceArray([10.]))
inp = net.create(1, LIF) pop
We implement three different projections between the same neurons, to highlight the three possible transmission mechanisms.
= net.connect(inp, pop, 'a')
proj =1.0)
proj.all_to_all(weights
= net.connect(inp, pop, 'b')
proj =1.0)
proj.all_to_all(weights
= net.connect(inp, pop, 'c')
proj =1.0) proj.all_to_all(weights
<ANNarchy.core.Projection.Projection at 0x11fb47fe0>
compile() net.
Compiling network 1... OK
We monitor the three conductances:
= net.monitor(pop, ['g_a', 'g_b', 'alpha_c']) m
inp.clear()100.) net.simulate(
= m.get() data
=(10, 10))
plt.figure(figsize311)
plt.subplot('g_a'][:, 0])
plt.plot(data["Instantaneous")
plt.ylabel(312)
plt.subplot('g_b'][:, 0])
plt.plot(data["Exponential")
plt.ylabel(313)
plt.subplot('alpha_c'][:, 0])
plt.plot(data["Time (ms)")
plt.xlabel("Alpha")
plt.ylabel( plt.show()