#!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 anp
import ANNarchy as ann
ann.clear()
ANNarchy 4.8 (4.8.2) 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 ="""
parameters tau = 20.
E_L = -70.
v_T = 0.
v_r = -58.
tau_b = 10.0
tau_c = 10.0
""",
="""
equations # Membrane potential
tau * dv/dt = (E_L - v) + g_a + g_b + alpha_c : init=-70.
# Exponentially decreasing
tau_b * dg_b/dt = -g_b : exponential
# Alpha-shaped
tau_c * dg_c/dt = -g_c : exponential
tau_c * dalpha_c/dt = exp((tau_c - dt/2.0)/tau_c) * g_c - alpha_c : exponential
""",
="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.SpikeSourceArray([10.])
inp = ann.Population(1, LIF) pop
We implement three different projections between the same neurons, to highlight the three possible transmission mechanisms.
= ann.Projection(inp, pop, 'a')
proj =1.0)
proj.connect_all_to_all(weights
= ann.Projection(inp, pop, 'b')
proj =1.0)
proj.connect_all_to_all(weights
= ann.Projection(inp, pop, 'c')
proj =1.0) proj.connect_all_to_all(weights
<ANNarchy.core.Projection.Projection at 0x10d5ea0d0>
compile() ann.
Compiling ... OK
We monitor the three conductances:
= ann.Monitor(pop, ['g_a', 'g_b', 'alpha_c']) m
inp.clear()100.) ann.simulate(
= m.get() data
import matplotlib.pyplot as plt
=(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()