Integrate-and-fire neurons

IF, AdEx and ExtendedIF. IF and AdEx combine a neuron model (param), a synapse model (synapse, which gives $I_{syn}$) and spike parameters (spike).

SNNModels.AbstractDendriteIF — Type
AbstractDendriteIF <: AbstractGeneralizedIF

Supertype of the multicompartment populations (an adaptive exponential soma coupled to passive dendritic compartments): Tripod and BallAndStick. Connections to these populations select the compartment with the target argument of synaptic_target (e.g. :s for the soma, :d or :d1/:d2 for the dendrites).

source
SNNModels.AbstractGeneralizedIF — Type
AbstractGeneralizedIF <: AbstractPopulation

Supertype of generalized integrate-and-fire populations. A concrete subtype combines three parameter objects:

  • param: the neuron model (an AbstractGeneralizedIFParameter, e.g. IFParameter),
  • synapse: the synapse model (an AbstractSynapseParameter, e.g. DoubleExpSynapse),
  • spike: the spike parameters (PostSpike),

and holds the state vectors v, fire, tabs, I, syn_curr, the synaptic state synvars and the receptors NamedTuple into which presynaptic spikes are written.

The generic step (integrate! in generalized_if/gif.jl) is

  1. update_synapses!(p, p.synapse, p.receptors, p.synvars, dt): add the spikes accumulated in receptors to the synaptic variables and integrate them;
  2. synaptic_current!(p, p.synapse, p.synvars): compute syn_curr from the synaptic variables and the membrane potential v;
  3. update_neuron!(p, p.param, dt): integrate the membrane equation, detect spikes, reset.

ExtendedIF and HetRec define their own integrate! instead.

source
SNNModels.AbstractGeneralizedIFParameter — Type
AbstractGeneralizedIFParameter <: AbstractPopulationParameter

Supertype of the neuron parameters of generalized integrate-and-fire models (IFParameter, AdExParameter, ExtendedIFParameter, HetRecParameter, the multicompartment parameters). make_heterogeneous accepts any subtype.

source
SNNModels.AbstractPopulationParameter — Type
AbstractPopulationParameter <: AbstractParameter

Supertype of the parameter types of populations (the param field of an AbstractPopulation).

The simulation loop dispatches on the pair (population, population.param): integrate!(p, p.param, dt) under sim! and train!, and in addition update_traces!(p, p.param, dt, T) and plasticity!(p, p.param, dt, T) under train!. For subtypes of AbstractPopulationParameter the fallbacks of these three functions do nothing, so a new model only needs to implement integrate!.

source
SNNModels.AbstractSpikeParameter — Type
AbstractSpikeParameter

Supertype of the spike parameters stored in the spike field of generalized integrate-and-fire populations. The only concrete subtype is PostSpike.

source
SNNModels.Population — Method
Population(param; kwargs...)
Population(; param, kwargs...)

Construct the population type that corresponds to the parameter object param. Methods exist for IFParameter (returns IF; requires synapse, spike and N), AdExParameter (returns AdEx; requires synapse and N, spike = PostSpike()), PoissonParameter subtypes (returns Poisson), InhomogeneousPoissonParam (returns InhomogeneousPoisson), IdentityParam (returns Identity) and HetRecParameter (returns HetRec); the multicompartment models add their own methods. Remaining keyword arguments are forwarded to the population constructor.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.Population(SNN.AdExParameter(); synapse = SNN.DoubleExpSynapse(), N = 50, name = "E")
P = SNN.Population(SNN.PoissonParameter(10Hz); N = 50)
source
SNNModels.integrate! — Method
integrate!(p::AbstractPopulation, param::AbstractPopulationParameter, dt)

Advance the state of population p by one time step dt (ms). Every population model implements a method of integrate! for its own parameter type; it is called once per step by sim! and train!, after the stimuli and before the connections. dt is converted to the precision of the population (float_type(p)). The fallback does nothing for a Float32 step and throws an ArgumentError for another precision (a model without a Float64 method).

See the documentation of each population type for the equations and the integration scheme.

source
SNNModels.make_heterogeneous — Method
make_heterogeneous(param::AbstractGeneralizedIFParameter, N::Int; kwargs...)

Return a copy of param in which every field is a Vector{Float32} of length N. For each field name passed as keyword argument, the values are drawn with rand(kwargs[field], N) (the argument can be a Distribution or any collection accepted by rand); the other fields are filled with the value they have in param. The result is built by calling the constructor of the same parameter type with FT = Vector{Float32}.

Only models whose update_neuron! indexes the parameters per neuron accept the result: in SNNModels 1.8.4 this is AdEx (method for AdExParameter{Vector{Float32}}). IF does not support vector-valued parameters.

Example

using SpikingNeuralNetworks
SNN.@load_units
param = SNN.make_heterogeneous(SNN.AdExParameter(), 50; El = SNN.SNNModels.Uniform(-72mV, -68mV))
E = SNN.AdEx(N = 50, param = param)
SNN.sim!([E]; duration = 100ms)
source
SNNModels.integrate! — Method
integrate!(p::AbstractGeneralizedIF, param::AbstractGeneralizedIFParameter, dt)

One integration step of a generalized integrate-and-fire population (IF, AdEx; the other models have their own method). Calls, in this order,

  1. update_synapses!(p, p.synapse, p.receptors, p.synvars, dt): the spikes written by the connections into p.receptors during the previous step are added to the synaptic variables, which are then integrated over dt; the receptor buffers are zeroed;
  2. synaptic_current!(p, p.synapse, p.synvars): computes p.syn_curr from the synaptic variables and the current membrane potential p.v;
  3. update_neuron!(p, param, dt): integrates the membrane (and adaptation) equations, detects spikes and applies reset and refractoriness.
source

IF

\[\begin{aligned} \tau_m \frac{dv}{dt} &= -(v - E_l) + R\,(I - w) - R\, I_{syn} \\ \tau_w \frac{dw}{dt} &= a\,(v - E_l) - w \end{aligned}\]

Spike when $v > V_t$: $v \leftarrow V_r$, $w \leftarrow w + b$, refractory for spike.τabs. τw = 0 (default) disables adaptation.

FieldDefaultUnitsMeaning
C, glunsetpF, nSgive τm = C / gl, R = 1nS / gl
τm15msmsmembrane time constant
R0.06GΩmembrane resistance
Vt-50mVmVspike threshold
Vr-60mVmVreset potential
El-70mVmVleak reversal potential
a0nSsubthreshold adaptation
b0pAspike-triggered adaptation increment
τw0msadaptation time constant
using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 100, param = SNN.IFParameter(C = 281pF, gl = 40nS, a = 4nS, b = 80.5pA, τw = 144ms))
E.I .= 1nA
SNN.monitor!(E, [:v, :w, :fire])
SNN.sim!([E]; duration = 200ms)
SNNModels.IF — Type
IF(; N = 100, param = IFParameter(), synapse = DoubleExpSynapse(), spike = PostSpike(),
     name = "IF", kwargs...)

Population of leaky integrate-and-fire neurons (optionally adaptive), combining the neuron model param::IFParameter, any synapse model synapse::AbstractSynapseParameter and the spike parameters spike::PostSpike.

Equations

\[\begin{aligned} \tau_m \frac{dv}{dt} &= -(v - E_l) + R\,(I - w) - R\, I_{syn} \\ \tau_w \frac{dw}{dt} &= a\,(v - E_l) - w, \qquad w \leftarrow w + b \text{ at each spike} \end{aligned}\]

See IFParameter for the parameters and the synapse model for $I_{syn}$.

Integration

One call of integrate! (see AbstractGeneralizedIF) updates the synapses, computes syn_curr, then update_neuron! performs, for each neuron:

  • if the refractory counter tabs > 0: fire = false, tabs -= 1, $v$ is not integrated (it stays at $V_r$);
  • otherwise one forward-Euler step v += dt / τm * (-(v - El) + R * (-w + I) - R * syn_curr); if v > Vt the neuron fires: v = Vr, tabs = round(Int, spike.τabs / dt).

Then, only if τw > 0, for every neuron w += b if it fired and w += dt * (a * (v - El) - w) / τw (forward Euler, using the updated $v$). tabs is initialised to 1, so the first step is skipped by every neuron.

Fields

  • param::IFParameter = IFParameter(): neuron parameters.
  • synapse::SYNT = DoubleExpSynapse(): synapse model.
  • spike::PST = PostSpike(): spike parameters (only τabs is used).
  • id::String = randstring(12), name::String = "IF".
  • N::Int32 = 100: number of neurons.
  • v::VFT: membrane potential (mV), initialised uniformly in [Vr, Vt]. IF(N = 10, VFT = Vector{Float64}) is a Float64 population: its parameters and synapse default to Float64 (see float_type); mixing precisions in one population is an ArgumentError.
  • w::VFT: adaptation current (pA), zeros.
  • fire::Vector{Bool}: spike flags of the last step.
  • spikes::SpikeIndex: neurons that fired in the step (see spike_index).
  • tabs::Vector{Int}: refractory counters (steps), ones.
  • I::VFT: external current (pA), zeros.
  • syn_curr::VFT: total synaptic current (pA).
  • synvars: synaptic state, synaptic_variables(synapse, N).
  • receptors::NamedTuple: spike input buffers, synaptic_receptors(synapse, N) ((glu, gaba) for the two-receptor synapse models). Connections target them with the symbols :ge/:glu/:he (excitatory) and :gi/:gaba/:hi (inhibitory).
  • records::Dict: recordings.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 100, param = SNN.IFParameter(C = 281pF, gl = 40nS))
E.I .= 1nA                       # constant external current
SNN.monitor!(E, [:v, :fire])
SNN.sim!([E]; duration = 200ms)
source
SNNModels.IFParameter — Type
IFParameter{FT = Float32}(; C, gl, τm, R, Vt = -50mV, Vr = -60mV, El = -70mV,
                           ΔT = 2mV, a = 0, b = 0, τw = 0)

Neuron parameters of the leaky integrate-and-fire model IF, with optional subthreshold and spike-triggered adaptation (adaptive IF when τw > 0).

Membrane parameters

C, gl, R and τm satisfy τm = C / gl and R = 1nS / gl; the model integrates with τm and R. Give them as a pair of independent values, any of (C, gl), (C, R), (C, τm), (gl, τm), (R, τm), and the other two are derived; give none and the default pair τm = 15ms, R = 0.06 (GΩ, i.e. 60 MΩ; then gl ≈ 16.7nS, C = 250pF) is used. A single value is an error: a given value is never combined with a default. More values are accepted if consistent. Changing one of them later (@update!, with_membrane) keeps the others consistent: τm keeps gl (changes C), C keeps gl (changes τm), gl or R keeps C (changes τm). See resolve_membrane and membrane_update. Up to SNNModels 1.8.x a single value was combined with the defaults (e.g. C alone was ignored and τm = 15ms); since 1.9.0 it is an error.

Equations

\[\begin{aligned} \tau_m \frac{dv}{dt} &= -(v - E_l) + R\,(I - w) - R\, I_{syn} \\ \tau_w \frac{dw}{dt} &= a\,(v - E_l) - w \end{aligned}\]

with $I_{syn}$ the synaptic current computed by the synapse model of the population (syn_curr, e.g. $I_{syn} = g_E (v - E_E) + g_I (v - E_I)$ for DoubleExpSynapse) and $I$ the external current (field I of the population). When $v > V_t$: $v \leftarrow V_r$, $w \leftarrow w + b$ and the neuron is refractory for spike.τabs. The adaptation variable is integrated only if τw > 0.

Fields

  • C::FT: membrane capacitance (pF); default from the pair, 250 pF.
  • gl::FT: leak conductance (nS); default from the pair, 16.7 nS.
  • τm::FT: membrane time constant (ms); default 15 ms.
  • Vt::FT = -50mV: spike threshold (mV).
  • Vr::FT = -60mV: reset potential (mV).
  • El::FT = -70mV: leak reversal potential (mV).
  • R::FT: membrane resistance (GΩ); default 0.06.
  • ΔT::FT = 2mV: slope factor (mV); not used by IF.
  • a::FT = 0.0: subthreshold adaptation conductance (nS).
  • b::FT = 0.0: spike-triggered adaptation increment (pA).
  • τw::FT = 0.0: adaptation time constant (ms); 0 disables adaptation.

Example

using SpikingNeuralNetworks
SNN.@load_units
param = SNN.IFParameter(C = 281pF, gl = 40nS, a = 4nS, b = 80.5pA, τw = 144ms)
E = SNN.IF(N = 10, param = param)
source
SNNModels.update_neuron! — Method
update_neuron!(p::AbstractGeneralizedIF, param::AbstractGeneralizedIFParameter, dt)

Third stage of integrate! for generalized integrate-and-fire populations: integrate the membrane (and adaptation) equations over dt using the synaptic current p.syn_curr, detect spikes, apply reset and refractoriness. Each model has its own method (IF, AdEx with scalar or per-neuron parameters, ExtendedIF, multicompartment models); see their docstrings for the update order.

This method (IF): forward Euler, threshold Vt, reset Vr, refractory counter tabs; adaptation w only if τw > 0.

source

AdEx

\[\begin{aligned} \tau_m \frac{dv}{dt} &= -(v - E_l) + \Delta_T \exp\!\left(\frac{v - \theta}{\Delta_T}\right) - R\, I_{syn} - R\, w + R\, I \\ \tau_w \frac{dw}{dt} &= a\,(v - E_l) - w \\ \tau_A \frac{d\theta}{dt} &= V_t - \theta \end{aligned}\]

Spike when $v \geq 0$ mV: $v \leftarrow V_r$ at the next step, $w \leftarrow w + b$, $\theta \leftarrow \theta + A_t$, refractory for spike.τabs.

FieldDefaultUnitsMeaning
C281pFpFmembrane capacitance
gl40nSnSleak conductance
τm, RC / gl, 1nS / glms, GΩmembrane time constant and resistance
Vt-50mVmVthreshold of the exponential term
Vr-70.6mVmVreset potential
El-70.6mVmVleak reversal potential
ΔT2mVmVslope factor
τw144msmsadaptation time constant
a4nSnSsubthreshold adaptation
b80.5pApAspike-triggered adaptation increment
using SpikingNeuralNetworks
SNN.@load_units
E = SNN.AdEx(N = 10, param = SNN.AdExParameter(), spike = SNN.PostSpike(τabs = 2ms, At = 2mV, τA = 30ms))
E.I .= 1nA
SNN.monitor!(E, [:v, :w, :fire])
SNN.sim!([E]; duration = 500ms)
SNNModels.AdEx — Type
AdEx(; N = 100, param = AdExParameter(), synapse = DoubleExpSynapse(), spike = PostSpike(),
       name = "AdEx", kwargs...)

Population of adaptive exponential integrate-and-fire neurons with an adaptive spike threshold, combining param::AdExParameter, any synapse model and spike::PostSpike.

Equations

\[\begin{aligned} \tau_m \frac{dv}{dt} &= -(v - E_l) + \Delta_T \exp\!\left(\frac{v - \theta}{\Delta_T}\right) - R\, I_{syn} - R\, w + R\, I \\ \tau_w \frac{dw}{dt} &= a\,(v - E_l) - w \\ \tau_A \frac{d\theta}{dt} &= V_t - \theta \end{aligned}\]

A spike is emitted when $v \geq 0$ mV; then $v$ is set to 20 mV for that step, $w \leftarrow w + b$, $\theta \leftarrow \theta + A_t$, and the neuron is refractory. $I_{syn}$ is the synaptic current of the synapse model (syn_curr), $τ_A$, $A_t$ and τabs come from spike (with the default At = 0mV the threshold stays at Vt).

Integration

Forward Euler, per neuron and per step (update_neuron!):

  1. if the neuron fired in the previous step, v = Vr (reset);
  2. fire = false; tabs -= 1; if tabs > 0 the neuron is refractory and nothing else is updated (so $v$ stays at $V_r$ and $w$, $θ$ are frozen);
  3. w += dt * (a * (v - El) - w) / τw (with the old $v$);
  4. v += dt * (-(v - El) + ΔT * exp((v - θ) / ΔT) - R * syn_curr - R * w + R * I) / τm (exponential term omitted if ΔT < 0);
  5. θ += dt * (Vt - θ) / τA;
  6. if v >= 0mV: fire = true, v = 20mV, w += b, θ += At, tabs = round(Int, τabs / dt).

After a spike the neuron is therefore clamped for round(Int, τabs / dt) - 1 steps.

Fields

  • name::String = "AdEx", id::String = randstring(12).
  • param::AdExParameter = AdExParameter(), synapse = DoubleExpSynapse(), spike::PostSpike = PostSpike().
  • N::Int32 = 100: number of neurons.
  • v::VFT: membrane potential (mV), uniform in [Vr, Vt]. VFT = Vector{Float64} gives a Float64 population (see float_type).
  • w::VFT: adaptation current (pA), zeros.
  • fire::Vector{Bool}: spike flags.
  • spikes::SpikeIndex: neurons that fired in the step (see spike_index).
  • θ::VFT: adaptive threshold of the exponential term (mV), initialised to Vt.
  • tabs::Vector{Int}: refractory counters (steps), ones.
  • I::VFT: external current (pA).
  • syn_curr::VFT: synaptic current (pA).
  • synvars: synaptic state; receptors::NamedTuple: spike input buffers (see IF).
  • records::Dict.

References

Brette R., Gerstner W. (2005). Adaptive exponential integrate-and-fire model as an effective description of neuronal activity. J. Neurophysiol. 94:3637-3642.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.AdEx(N = 10, param = SNN.AdExParameter(), spike = SNN.PostSpike(τabs = 2ms))
E.I .= 1nA
SNN.monitor!(E, [:v, :w, :fire])
SNN.sim!([E]; duration = 500ms)
source
SNNModels.AdExParameter — Type
AdExParameter{FT = Float32}(; C, gl, τm, R, Vt = -50mV, Vr = -70.6mV, El = -70.6mV,
                             ΔT = 2mV, τw = 144ms, a = 4nS, b = 80.5pA)

Neuron parameters of the adaptive exponential integrate-and-fire model (AdEx), in the parameterisation of Brette and Gerstner (2005). The code comment notes that the original paper uses a leak conductance of 30 nS; the default here is 40 nS.

AdExParameter is mutable. With FT = Vector{Float32} (see make_heterogeneous) every parameter is per neuron and AdEx uses the heterogeneous method of update_neuron!.

Membrane parameters

C, gl, R and τm satisfy τm = C / gl and R = 1nS / gl. AdEx integrates with τm and R; Tripod and BallAndStick, which hold an AdExParameter in their adex field, integrate with C and gl. Give them as a pair of independent values, any of (C, gl), (C, R), (C, τm), (gl, τm), (R, τm), and the other two are derived; give none and the default pair C = 281pF, gl = 40nS is used. A single value is an error: a given value is never combined with a default. More values are accepted if consistent. Changing one of them later (@update!, property assignment p.τm = x, with_membrane, make_heterogeneous) keeps the others consistent: τm keeps gl (changes C), C keeps gl (changes τm), gl or R keeps C (changes τm). See resolve_membrane and membrane_update. Up to SNNModels 1.8.x the four fields were independent after construction: setting τm had no effect on Tripod and BallAndStick, and τm alone was combined with the default C, gl.

Fields

  • C::FT: membrane capacitance (pF); default 281 pF.
  • gl::FT: leak conductance (nS); default 40 nS.
  • Vt::FT = -50mV: threshold of the exponential term (rheobase threshold), also the resting value of the adaptive threshold $θ$ (mV). It is not the spike-detection threshold (0 mV).
  • Vr::FT = -70.6mV: reset potential (mV).
  • El::FT = -70.6mV: leak reversal potential (mV).
  • τm::FT: membrane time constant (ms), C / gl, 7.025 ms with the defaults.
  • R::FT: membrane resistance (GΩ), 1nS / gl, 0.025 GΩ with the defaults.
  • ΔT::FT = 2mV: slope factor of the exponential term (mV); a negative value removes the exponential term.
  • τw::FT = 144ms: adaptation time constant (ms).
  • a::FT = 4nS: subthreshold adaptation conductance (nS).
  • b::FT = 80.5pA: spike-triggered adaptation increment (pA).

References

Brette R., Gerstner W. (2005). Adaptive exponential integrate-and-fire model as an effective description of neuronal activity. J. Neurophysiol. 94:3637-3642.

Example

using SpikingNeuralNetworks
SNN.@load_units
param = SNN.AdExParameter(a = 0nS, b = 0pA)   # exponential IF without adaptation
E = SNN.AdEx(N = 10, param = param)
source

Membrane parameters

C, gl, R and τm are tied by $\tau_m = C / g_L$ and $R = 1\,\mathrm{nS} / g_L$:

givenresult
nothingdefault pair
one valueArgumentError
two valuesthe other two are derived
more than twoaccepted if consistent within 0.1 %
using SpikingNeuralNetworks
SNN.@load_units
p = SNN.AdExParameter(gl = 40nS, τm = 20ms)     # C = 800pF
SNN.@update! p τm = 10ms                         # gl kept: C = 400pF
q = SNN.with_membrane(p; C = 281pF, gl = 40nS)   # new pair: τm = 7.025ms
SNNModels.membrane_update — Method
membrane_update(current::NamedTuple, new::NamedTuple) -> (; C, gl, R, τm)

Membrane quadruple after changing some of its members. current holds the four consistent values, new the changed ones (keys among C, gl, R, τm).

  • If new alone determines a pair (two independent values, see resolve_membrane), the result is resolved from new only.
  • If new changes one quantity, the others follow a fixed rule:
    • τm: gl (and R) are kept, C = τm * gl;
    • C: gl (and R) are kept, τm = C / gl;
    • gl or R: C is kept, τm = C / gl and R = 1nS / gl (or gl = 1nS / R).

So changing τm changes the capacitance, the quantity Tripod and BallAndStick integrate with.

source
SNNModels.resolve_membrane — Method
resolve_membrane(C, gl, R, τm; default, name = "") -> (; C, gl, R, τm)

Complete the membrane quadruple from the values that were given (a value is "not given" when it is NaN, the field default of AdExParameter and IFParameter). With $\tau_m = C / g_l$ and $R = 1\,\mathrm{nS} / g_l$:

  • nothing given: the type's default pair default is used (AdEx: C = 281pF, gl = 40nS; IF: τm = 15ms, R = 0.06);
  • exactly one independent value given: ArgumentError. A default is never combined with a given value, so a single value does not determine the others;
  • two independent values given, any of (C, gl), (C, R), (C, τm), (gl, τm), (R, τm): the other two are derived. gl and R are the same quantity; if both are given they must agree;
  • three or more given: accepted when they are consistent (relative tolerance 1e-3, so that values rounded to four significant digits pass), otherwise ArgumentError. This is the case when an existing parameter is rebuilt with all its fields.

Values can be scalars or vectors (heterogeneous parameters); the relations are applied element-wise.

source
SNNModels.with_membrane — Method
with_membrane(p; C, gl, R, τm)

Copy of the parameter p (AdExParameter or IFParameter) with membrane parameters changed by membrane_update: one value follows the update rule, two independent values define the new pair. @update! on one of these fields and property assignment on the mutable AdExParameter use the same rule.

Example

using SpikingNeuralNetworks
SNN.@load_units
p = SNN.AdExParameter()                       # C = 281pF, gl = 40nS, τm = 7.025ms
q = SNN.with_membrane(p; τm = 20ms)           # gl kept: C = 800pF
r = SNN.with_membrane(p; τm = 20ms, C = 281pF) # new pair: gl = 14.05nS
source

PostSpike

FieldDefaultUnitsMeaning
At0mVmVadaptive-threshold increment per spike
τA10msmsrelaxation time of the threshold
AP_membrane10mVmVsomatic potential during the action potential (dendritic models)
τabs1msmsabsolute refractory period
up1msmsaction-potential duration (dendritic models)
SNNModels.PostSpike — Type
PostSpike{FT = Float32}(; At = 0mV, τA = 10ms, AP_membrane = 10mV, τabs = 1ms, up = 1ms)

Spike-related parameters shared by the generalized integrate-and-fire populations (IF, AdEx, Tripod, BallAndStick). Passed as the spike field of the population.

Which fields are read depends on the model:

  • IF: only τabs.
  • AdEx: τabs, At, τA (adaptive threshold). The spike peak is hard-coded to 20 mV in AdEx, AP_membrane is not used there.
  • Tripod / BallAndStick: τabs, up, At, τA, AP_membrane.

Fields

  • At::FT = 0mV: increment of the adaptive spike threshold $θ$ at each spike (mV).
  • τA::FT = 10ms: time constant with which $θ$ relaxes back to Vt (ms).
  • AP_membrane::FT = 10mV: somatic membrane potential imposed during the action potential (multicompartment models only) (mV).
  • τabs::FT = 1ms: absolute refractory period (ms). It is converted to an integer number of steps round(Int, τabs / dt) when a spike occurs.
  • up::FT = 1ms: duration of the action potential (multicompartment models only); these models set the refractory counter to round(Int, (up + τabs) / dt) (ms).

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.AdEx(N = 10, spike = SNN.PostSpike(τabs = 2ms, At = 5mV, τA = 30ms))
source

Heterogeneous parameters

using SpikingNeuralNetworks
SNN.@load_units
param = SNN.make_heterogeneous(SNN.AdExParameter(), 50; El = SNN.SNNModels.Uniform(-72mV, -68mV))
E = SNN.AdEx(N = 50, param = param)
SNN.sim!([E]; duration = 100ms)

ExtendedIF

Excitatory, PV-like and SST-like conductances with an excitation-SST interaction; no synapse field.

\[\begin{aligned} C_m \frac{dv}{dt} &= g_l (E_l - v) + g_E (E_e - v) + g_{PV} (E_i - v) + g_{SST} (E_i - v) - \alpha\, g_E\, g_{SST} (E_e - v) + I \\ \frac{dg_E}{dt} &= -\frac{g_E}{\tau_e}, \qquad \frac{dg_{PV}}{dt} = -\frac{g_{PV}}{\tau_i}, \qquad \frac{dg_{SST}}{dt} = -\frac{g_{SST}}{\tau_i} \end{aligned}\]

FieldDefaultUnitsMeaning
Cm250pFpFmembrane capacitance
Vt-40mVmVspike threshold
Vr-65mVmVreset potential
El-70mVmVleak reversal potential
gl10nSnSleak conductance
τe6msmsdecay of g_Exc
τi20msmsdecay of g_PV and g_SST
E_i-75mVmVinhibitory reversal potential
E_e0mVmVexcitatory reversal potential
τabs5msmsabsolute refractory period
α01/nSexcitation-SST interaction strength

Targets: :g_Exc (:ge, :glu), :g_PV (:gi, :gaba), :g_SST.

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.ExtendedIF(N = 10, param = SNN.ExtendedIFParameter(α = 0.01))
E.I .= 400pA
SNN.monitor!(E, [:v, :fire])
SNN.sim!([E]; duration = 100ms)
SNNModels.ExtendedIF — Type
ExtendedIF(; N = 100, param = ExtendedIFParameter(), name = "ExtendedIF", kwargs...)

Conductance-based integrate-and-fire population with excitatory (g_Exc), PV (g_PV) and SST (g_SST) conductances and an optional multiplicative interaction between excitation and SST inhibition. Unlike IF and AdEx, it has no synapse field: the conductances are fields of the population and decay exponentially. Connections target one of the conductances: SpikingSynapse(pre, post, sym; conn) with sym in :g_Exc, :g_PV, :g_SST; :ge/:glu are mapped to :g_Exc and :gi/:gaba to :g_PV. A spike of weight $w$ (nS) increments the conductance by $w$.

Equations

\[\begin{aligned} C_m \frac{dv}{dt} &= g_l (E_l - v) + g_E (E_e - v) + g_{PV} (E_i - v) + g_{SST} (E_i - v) - \alpha\, g_E\, g_{SST} (E_e - v) + I \\ \frac{dg_E}{dt} &= -\frac{g_E}{\tau_e}, \qquad \frac{dg_{PV}}{dt} = -\frac{g_{PV}}{\tau_i}, \qquad \frac{dg_{SST}}{dt} = -\frac{g_{SST}}{\tau_i} \end{aligned}\]

Spike when $v > V_t$, then $v \leftarrow V_r$ and refractoriness for τabs.

Integration

integrate! first decays the three conductances (forward Euler), then updates each neuron: if tabs > 0 the neuron is refractory (fire = false, tabs -= 1, $v$ unchanged); otherwise one forward-Euler step of $v$, threshold test, reset to Vr and tabs = round(Int, τabs / dt).

Fields

  • id::String = randstring(12), name::String = "ExtendedIF".
  • param::ExtendedIFParameter = ExtendedIFParameter().
  • N::Int32 = 100.
  • v::VFT: membrane potential (mV), uniform in [Vr, Vt]. VFT = Vector{Float64} gives a Float64 population (see float_type).
  • g_Exc, g_PV, g_SST: conductances (nS), zeros.
  • tabs: refractory counters (steps, stored in the float type of the state), zeros.
  • w: unused by the dynamics, zeros.
  • fire::Vector{Bool}; I: external current (pA); records::Dict.
  • spikes::SpikeIndex: neurons that fired in the step (see spike_index).
  • Δv, Δv_temp: unused buffers.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.ExtendedIF(N = 10, param = SNN.ExtendedIFParameter(α = 0.01))
E.I .= 400pA
SNN.monitor!(E, [:v, :fire])
SNN.sim!([E]; duration = 100ms)
source
SNNModels.ExtendedIFParameter — Type
ExtendedIFParameter{FT = Float32}(; Cm = 250pF, Vt = -40mV, Vr = -65mV, El = -70mV,
                                   gl = 10nS, τe = 6ms, τi = 20ms, E_i = -75mV,
                                   E_e = 0mV, τabs = 5ms, α = 0)

Parameters of ExtendedIF, a conductance-based integrate-and-fire neuron with three synaptic conductances (excitatory, PV-like and SST-like inhibition) and a multiplicative excitation-SST interaction term.

Fields

  • Cm::FT = 250pF: membrane capacitance (pF).
  • Vt::FT = -40mV: spike threshold (mV).
  • Vr::FT = -65mV: reset potential (mV).
  • El::FT = -70mV: leak reversal potential (mV).
  • gl::FT = 10nS: leak conductance (nS); the code marks this value as arbitrary.
  • τe::FT = 6ms: decay time constant of g_Exc (ms).
  • τi::FT = 20ms: decay time constant of g_PV and g_SST (ms).
  • E_i::FT = -75mV: inhibitory reversal potential (mV), used by both PV and SST conductances.
  • E_e::FT = 0mV: excitatory reversal potential (mV).
  • τabs::FT = 5ms: absolute refractory period (ms).
  • α::FT = 0.0: strength of the interaction term $-α\, g_E\, g_{SST} (E_e - v)$ (1/nS); 0 disables it ("dendritic interaction term" in the code).

Reference not given in the code.

source