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 <: AbstractGeneralizedIFSupertype 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).
SNNModels.AbstractGeneralizedIF — Type
AbstractGeneralizedIF <: AbstractPopulationSupertype of generalized integrate-and-fire populations. A concrete subtype combines three parameter objects:
param: the neuron model (anAbstractGeneralizedIFParameter, e.g.IFParameter),synapse: the synapse model (anAbstractSynapseParameter, 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
update_synapses!(p, p.synapse, p.receptors, p.synvars, dt): add the spikes accumulated inreceptorsto the synaptic variables and integrate them;synaptic_current!(p, p.synapse, p.synvars): computesyn_currfrom the synaptic variables and the membrane potentialv;update_neuron!(p, p.param, dt): integrate the membrane equation, detect spikes, reset.
ExtendedIF and HetRec define their own integrate! instead.
SNNModels.AbstractGeneralizedIFParameter — Type
AbstractGeneralizedIFParameter <: AbstractPopulationParameterSupertype of the neuron parameters of generalized integrate-and-fire models (IFParameter, AdExParameter, ExtendedIFParameter, HetRecParameter, the multicompartment parameters). make_heterogeneous accepts any subtype.
SNNModels.AbstractPopulationParameter — Type
AbstractPopulationParameter <: AbstractParameterSupertype 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!.
SNNModels.AbstractSpikeParameter — Type
AbstractSpikeParameterSupertype of the spike parameters stored in the spike field of generalized integrate-and-fire populations. The only concrete subtype is PostSpike.
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)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.
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)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,
update_synapses!(p, p.synapse, p.receptors, p.synvars, dt): the spikes written by the connections intop.receptorsduring the previous step are added to the synaptic variables, which are then integrated overdt; the receptor buffers are zeroed;synaptic_current!(p, p.synapse, p.synvars): computesp.syn_currfrom the synaptic variables and the current membrane potentialp.v;update_neuron!(p, param, dt): integrates the membrane (and adaptation) equations, detects spikes and applies reset and refractoriness.
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.
| Field | Default | Units | Meaning |
|---|---|---|---|
C, gl | unset | pF, nS | give τm = C / gl, R = 1nS / gl |
τm | 15ms | ms | membrane time constant |
R | 0.06 | GΩ | membrane resistance |
Vt | -50mV | mV | spike threshold |
Vr | -60mV | mV | reset potential |
El | -70mV | mV | leak reversal potential |
a | 0 | nS | subthreshold adaptation |
b | 0 | pA | spike-triggered adaptation increment |
τw | 0 | ms | adaptation 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); ifv > Vtthe 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τabsis 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 aFloat64population: its parameters and synapse default toFloat64(seefloat_type); mixing precisions in one population is anArgumentError.w::VFT: adaptation current (pA), zeros.fire::Vector{Bool}: spike flags of the last step.spikes::SpikeIndex: neurons that fired in the step (seespike_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)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 byIF.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);0disables 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)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.
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.
| Field | Default | Units | Meaning |
|---|---|---|---|
C | 281pF | pF | membrane capacitance |
gl | 40nS | nS | leak conductance |
τm, R | C / gl, 1nS / gl | ms, GΩ | membrane time constant and resistance |
Vt | -50mV | mV | threshold of the exponential term |
Vr | -70.6mV | mV | reset potential |
El | -70.6mV | mV | leak reversal potential |
ΔT | 2mV | mV | slope factor |
τw | 144ms | ms | adaptation time constant |
a | 4nS | nS | subthreshold adaptation |
b | 80.5pA | pA | spike-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!):
- if the neuron fired in the previous step,
v = Vr(reset); fire = false;tabs -= 1; iftabs > 0the neuron is refractory and nothing else is updated (so $v$ stays at $V_r$ and $w$, $θ$ are frozen);w += dt * (a * (v - El) - w) / τw(with the old $v$);v += dt * (-(v - El) + ΔT * exp((v - θ) / ΔT) - R * syn_curr - R * w + R * I) / τm(exponential term omitted ifΔT < 0);θ += dt * (Vt - θ) / τA;- 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 aFloat64population (seefloat_type).w::VFT: adaptation current (pA), zeros.fire::Vector{Bool}: spike flags.spikes::SpikeIndex: neurons that fired in the step (seespike_index).θ::VFT: adaptive threshold of the exponential term (mV), initialised toVt.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 (seeIF).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)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)Membrane parameters
C, gl, R and τm are tied by $\tau_m = C / g_L$ and $R = 1\,\mathrm{nS} / g_L$:
| given | result |
|---|---|
| nothing | default pair |
| one value | ArgumentError |
| two values | the other two are derived |
| more than two | accepted 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.025msSNNModels.MembraneParameter — Type
Parameter types whose C, gl, R, τm follow the membrane pair rule.
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
newalone determines a pair (two independent values, seeresolve_membrane), the result is resolved fromnewonly. - If
newchanges one quantity, the others follow a fixed rule:τm:gl(andR) are kept,C = τm * gl;C:gl(andR) are kept,τm = C / gl;glorR:Cis kept,τm = C / glandR = 1nS / gl(orgl = 1nS / R).
So changing τm changes the capacitance, the quantity Tripod and BallAndStick integrate with.
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
defaultis 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.
glandRare 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.
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.05nSPostSpike
| Field | Default | Units | Meaning |
|---|---|---|---|
At | 0mV | mV | adaptive-threshold increment per spike |
τA | 10ms | ms | relaxation time of the threshold |
AP_membrane | 10mV | mV | somatic potential during the action potential (dendritic models) |
τabs | 1ms | ms | absolute refractory period |
up | 1ms | ms | action-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 inAdEx,AP_membraneis 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 toVt(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 stepsround(Int, τabs / dt)when a spike occurs.up::FT = 1ms: duration of the action potential (multicompartment models only); these models set the refractory counter toround(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))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}\]
| Field | Default | Units | Meaning |
|---|---|---|---|
Cm | 250pF | pF | membrane capacitance |
Vt | -40mV | mV | spike threshold |
Vr | -65mV | mV | reset potential |
El | -70mV | mV | leak reversal potential |
gl | 10nS | nS | leak conductance |
τe | 6ms | ms | decay of g_Exc |
τi | 20ms | ms | decay of g_PV and g_SST |
E_i | -75mV | mV | inhibitory reversal potential |
E_e | 0mV | mV | excitatory reversal potential |
τabs | 5ms | ms | absolute refractory period |
α | 0 | 1/nS | excitation-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 aFloat64population (seefloat_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 (seespike_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)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 ofg_Exc(ms).τi::FT = 20ms: decay time constant ofg_PVandg_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);0disables it ("dendritic interaction term" in the code).
Reference not given in the code.