Populations

    This page documents the populations model available in SpikingNeuralNetworks.jl. Models can be extended or added following the guidelines in Model Extensions

    Generalized Integrate and Fire models

    This set of models are implementations of the abstract type: AbstractGeneralizedIFParameter.

    Leaky Integrate and Fire model

    The leaky integrate-and-fire is one of the simplest model for neuronal integration. It implements this equation:

    \[\begin{align} \frac{dV}{dt} &= - \frac{(V - E_l)}{\tau_m} + R (-w + I - I_{syn}) \\ \\ \frac{dw}{dt} &= \frac{(a (V - E_l) - w)}{\tau_w} \end{align}\]

    Where the adaptations parameters are optional and set to zero by default.

    SNNModels.IFParameterType
    IFParameter{FT<:AbstractFloat} <: AbstractGeneralizedIFParameter

    This struct implements the Integrate-and-Fire neuron model with optional adaptation currents. The default parameters are based on the standard Izhikevich model but adapted for generalized integrate-and-fire dynamics.

    Fields

    • C::FT: Membrane capacitance (default: 281 pF)
    • gl::FT: Leak conductance (default: 40 nS)
    • τm::FT: Membrane time constant (default: 20 ms)
    • Vt::FT: Membrane threshold potential (default: -50 mV)
    • Vr::FT: Membrane reset potential (default: -60 mV)
    • El::FT: Membrane leak potential (default: -70 mV)
    • R::FT: Membrane resistance (calculated as 1/gl)
    • a::FT: Subthreshold adaptation parameter (default: 0.0)
    • b::FT: Spike-triggered adaptation current increment (default: 0.0)
    • τw::FT: Adaptation time constant (default: 0.0)
    source
    SNNModels.IFType
    IF{VFT, VBT, GIFT, SYNT} <: AbstractGeneralizedIF

    This struct represents a population of neurons following the generalized Integrate-and-Fire model with optional adaptation currents. Also in this case, the model supports any synaptic model.

    Fields

    Population Info

    • name::String: Name of the population (default: "IF")
    • id::String: Unique identifier for the population (default: random 12-character string)

    Model Parameters

    • param::IFParameter: Neuron parameters (default: IFParameter())
    • synapse::SYNT: Synapse parameters (default: DoubleExpSynapse())
    • spike::PST: Post-spike behavior parameters (default: PostSpike())
    • records::Dict: Dictionary for storing simulation records (default: empty)
    • N::Int32: Number of neurons in the population (default: 100)

    Model Variables

    • v::VFT: Membrane potentials (initialized between Vr and Vt)
    • glu::VFT: Excitatory synaptic currents (default: zeros)
    • gaba::VFT: Inhibitory synaptic currents (default: zeros)
    • tabs::VFT: Absolute refractory periods (default: zeros)
    • w::VFT: Adaptation currents (default: zeros)
    • fire::VBT: Spike flags (default: zeros)
    • I::VFT: External currents (default: zeros)
    • syn_curr::VFT: Total synaptic currents (default: zeros)

    Type Parameters

    • VFT: Type of vector for floating-point values (default: Vector{Float32})
    • VBT: Type of vector for boolean values (default: Vector{Bool})
    source

    Adaptive Exponential model

    The AdEx model is an expansion of the IF, it has a non-linear function of the membrane potential that is activated when the potential is above a threshold $\theta$

    \[\begin{align} \frac{dV}{dt} &= - \frac{(V - E_l)}{\tau_m} + \Delta T \exp{\frac{V - \theta}{\Delta T}} + R (-w + I - I_{syn}) \\ \\ \frac{dw}{dt} &= \frac{(a (V - E_l) - w)}{\tau_w} \end{align}\]

    where the adaptations parameters are optional and set to zero by default.

    SNNModels.AdExParameterType
    AdExParameter{FT} <: AbstractGeneralizedIFParameter

    The AdEx model extends the leaky integrate-and-fire model with exponential spiking dynamics and spike-triggered adaptation. This implementation follows the parameterization from Brette and Gerstner (2005).

    Fields

    • C::FT: Membrane capacitance (default: 281 pF)
    • gl::FT: Leak conductance (default: 40 nS)
    • Vt::FT: Membrane potential threshold (default: -50 mV)
    • Vr::FT: Reset potential (default: -70.6 mV)
    • El::FT: Resting membrane potential (default: -70.6 mV)
    • τm::FT: Membrane time constant (default: C/gl)
    • R::FT: Resistance (default: nS/gl)
    • ΔT::FT: Slope factor (default: 2 mV)
    • τw::FT: Adaptation time constant (default: 144 ms)
    • a::FT: Subthreshold adaptation parameter (default: 4 nS)
    • b::FT: Spike-triggered adaptation parameter (default: 80.5 pA)
    source
    SNNModels.AdExType
    AdEx{VFT, MFT,  GIFT, SYNT} <: AbstractGeneralizedIF

    The AdEx model implements the adaptive exponential integrate-and-fire neuron model with support for any synaptic model.

    Fields

    Population Info

    • name::String: Name of the neuron model (default: "AdEx")
    • id::String: Unique identifier for the neuron population (default: random 12-character string)
    • records::Dict: Dictionary for storing simulation records (initialized empty)

    Model Parameters

    • param::GIFT: Parameters for the AdEx model (default: AdExParameter())
    • synapse::SYNT: Synaptic parameters (default: DoubleExpSynapse())
    • spike::PST: Post-spike parameters (default: PostSpike())
    • N::Int32: Number of neurons in the population (default: 100)

    Model variable

    • v::VFT: Membrane potential (initialized randomly between Vr and Vt)
    • w::VFT: Adaptation current (initialized to zeros)
    • fire::VBT: Spike flags (initialized to false)
    • θ::VFT: Membrane potential thresholds (initialized to Vt)
    • tabs::VIT: Absolute refractory period counters (initialized to ones)
    • I::VFT: External current (initialized to zeros)
    • syn_curr::VFT: Total synaptic current (initialized to zeros)

    Synapses

    • synvars::SYNV: Synaptic variables for the synapse model
    • receptors<:NamedTuple: Synaptic receptors triggered by spike events
    source

    Generalized Integrated and Fire synapses

    Models of the type Generalized IF implements can implement any type of synapse that is subtype of AbstractSynapseParameter.

    AbstractSynapseParameter must implement the following

    A list of

    SNNModels.AbstractSynapseParameterType
    AbstractSynapseParameter <: AbstractComponent

    Abstract type representing parameters for synaptic models.

    Methods

    • get_synapse_symbol(synapse::T, sym::Symbol) where {T<:AbstractSynapseParameter}: Returns the appropriate synapse symbol based on input.

    • synaptic_variables(synapse::AbstractSynapseParameter, N::Int): Creates synaptic variables for a given synapse type and number of neurons.

    • update_synapses!(p::P, synapse::T, glu::Vector{Float32}, gaba::Vector{Float32}, synvars::AbstractSynapseVariable, dt::Float32) where {P<:AbstractGeneralizedIF,T<:AbstractSinExpParameter}: Updates synaptic variables.

    • synaptic_current!(p::P, synapse::T, synvars::AbstractSynapseVariable, v::VT1, syncurr::VT2) where {P<:AbstractGeneralizedIF,T<:AbstractSinExpParameter, VT1 <:AbstractVector, VT2 <:AbstractVector}: Computes synaptic current.

    source
    SNNModels.Confavreux2025SynapseType
        DoubleExpSynapse{FT} <: AbstractDoubleExpParameter

    A synaptic parameter type that models double exponential synaptic dynamics.

    Fields

    • τAMPA::FT: Rise time constant for excitatory synapses (default: 5ms)
    • τNMDA::FT: Decay time constant for excitatory synapses (default: 100ms)
    • τGABA::FT: Rise time constant for inhibitory synapses (default: 10ms)
    • E_i::FT: Reversal potential for inhibitory synapses (default: -80mV)
    • E_e::FT: Reversal potential for excitatory synapses (default: 0mV)
    • α::FT: NMDA voltage dependence parameter (default: 0.23f0)

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements double exponential synaptic dynamics, where synaptic currents are calculated using separate rise and decay time constants for both excitatory and inhibitory synapses.

    source
    SNNModels.CurrentSynapseType
    CurrentSynapse{FT} <: AbstractCurrentParameter

    A synaptic parameter type that models current-based synaptic dynamics.

    Fields

    • τe::FT: Decay time constant for excitatory synapses (default: 6ms)
    • τi::FT: Decay time constant for inhibitory synapses (default: 2ms)
    • E_i::FT: Reversal potential for inhibitory synapses (default: -75mV)
    • E_e::FT: Reversal potential for excitatory synapses (default: 0mV)

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements current-based synaptic dynamics, where synaptic currents are calculated using separate time constants for both excitatory and inhibitory synapses.

    source
    SNNModels.DeltaSynapseType
    DeltaSynapse{FT} <: AbstractDeltaParameter

    A synaptic parameter type that models delta (instantaneous) synaptic dynamics.

    Fields

    None - this type implements instantaneous synaptic dynamics where synaptic inputs are applied directly without any time constants.

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements delta synaptic dynamics, where synaptic inputs are applied instantaneously without any time delays or decay. The synaptic current is calculated as the difference between excitatory and inhibitory inputs.

    source
    SNNModels.DoubleExpCurrentSynapseType
    DoubleExpCurrentSynapse{FT} <: AbstractDoubleExpCurrentParameter

    A synaptic parameter type that models double exponential current synaptic dynamics.

    Fields

    • τre::FT: Rise time constant for excitatory synapses (default: 1ms)
    • τde::FT: Decay time constant for excitatory synapses (default: 6ms)
    • τri::FT: Rise time constant for inhibitory synapses (default: 0.5ms)
    • τdi::FT: Decay time constant for inhibitory synapses (default: 2ms)

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements double exponential current synaptic dynamics, where synaptic currents are calculated using separate rise and decay time constants for both excitatory and inhibitory synapses.

    source
    SNNModels.DoubleExpSynapseType
    DoubleExpSynapse{FT} <: AbstractDoubleExpParameter

    A synaptic parameter type that models double exponential synaptic dynamics.

    Fields

    • τre::FT: Rise time constant for excitatory synapses (default: 1ms)
    • τde::FT: Decay time constant for excitatory synapses (default: 6ms)
    • τri::FT: Rise time constant for inhibitory synapses (default: 0.5ms)
    • τdi::FT: Decay time constant for inhibitory synapses (default: 2ms)
    • E_i::FT: Reversal potential for inhibitory synapses (default: -75mV)
    • E_e::FT: Reversal potential for excitatory synapses (default: 0mV)
    • gsyn_e::FT: Synaptic conductance for excitatory synapses (default: 1.0f0)
    • gsyn_i::FT: Synaptic conductance for inhibitory synapses (default: 1.0f0)

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements double exponential synaptic dynamics, where synaptic currents are calculated using separate rise and decay time constants for both excitatory and inhibitory synapses.

    source
    SNNModels.MultiReceptorSynapseType
    ReceptorSynapse{FT,VIT,ST,NMDAT,VFT} <: AbstractReceptorParameter

    A synaptic parameter type that models receptor-based synaptic dynamics with NMDA voltage dependence.

    Fields

    • NMDA::NMDAT: Parameters for NMDA voltage dependence (default: NMDAVoltageDependency())
    • glu_receptors::VIT: Indices of glutamate receptors (default: [1, 2])
    • gaba_receptors::VIT: Indices of GABA receptors (default: [3, 4])
    • syn::ST: Array of receptor parameters (default: SomaReceptors)

    Type Parameters

    • VIT: Vector of integers type (default: Vector{Int})
    • ST: Receptor array type (default: ReceptorArray)
    • NMDAT: NMDA voltage dependency type (default: NMDAVoltageDependency{Float32})

    This type implements conductance-based synaptic dynamics with AMPA, NMDA, GABAa, and GABAb receptors. Synaptic currents are calculated based on receptor activation and voltage-dependent NMDA modulation.

    source
    SNNModels.ReceptorSynapseType
    ReceptorSynapse{FT,VIT,ST,NMDAT,VFT} <: AbstractReceptorParameter

    A synaptic parameter type that models receptor-based synaptic dynamics with NMDA voltage dependence.

    Fields

    • NMDA::NMDAT: Parameters for NMDA voltage dependence (default: NMDAVoltageDependency())
    • glu_receptors::VIT: Indices of glutamate receptors (default: [1, 2])
    • gaba_receptors::VIT: Indices of GABA receptors (default: [3, 4])
    • syn::ST: Array of receptor parameters (default: SomaReceptors)

    Type Parameters

    • VIT: Vector of integers type (default: Vector{Int})
    • ST: Receptor array type (default: ReceptorArray)
    • NMDAT: NMDA voltage dependency type (default: NMDAVoltageDependency{Float32})

    This type implements conductance-based synaptic dynamics with AMPA, NMDA, GABAa, and GABAb receptors. Synaptic currents are calculated based on receptor activation and voltage-dependent NMDA modulation.

    source
    SNNModels.SingleExpSynapseType
    SingleExpSynapse{FT} <: AbstractSinExpParameter

    A synaptic parameter type that models single exponential synaptic dynamics.

    Fields

    • τe::FT: Decay time constant for excitatory synapses (default: 6ms)
    • τi::FT: Rise time constant for inhibitory synapses (default: 0.5ms)
    • E_i::FT: Reversal potential for inhibitory synapses (default: -75mV)
    • E_e::FT: Reversal potential for excitatory synapses (default: 0mV)
    • gsyn_e::FT: Synaptic conductance for excitatory synapses (default: 1.0f0)
    • gsyn_i::FT: Synaptic conductance for inhibitory synapses (default: 1.0f0)

    Type Parameters

    • FT: Floating point type (default: Float32)

    This type implements single exponential synaptic dynamics, where synaptic currents are calculated using separate time constants for both excitatory and inhibitory synapses.

    source
    SNNModels.AbstractSynapseVariableType
    AbstractSynapseVariable <: AbstractComponent

    Abstract type representing synaptic variables for synaptic models.

    This type serves as a base for various synaptic variable implementations corresponding to different synapse parameter types. The synaptic variables store state information necessary for simulating synaptic dynamics.

    Available subtypes

    • CurrentSynapseVars
    • DeltaSynapseVars
    • DoubleExpSynapseVars
    • SingleExpSynapseVars
    • ReceptorSynapseVars
    source
    SNNModels.Confavreux2025SynapseVarsType
    DoubleExpSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for double exponential synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • gAMPA::VFT: Vector of AMPA conductances
    • gNMDA::VFT: Vector of NMDA conductances
    • gGABA::VFT: Vector of GABA conductances
    source
    SNNModels.CurrentSynapseVarsType
    CurrentSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for current-based synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • ge::VFT: Vector of excitatory conductances
    • gi::VFT: Vector of inhibitory conductances
    source
    SNNModels.DeltaSynapseVarsType

    DeltaSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for delta synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • ge::VFT: Vector of excitatory conductances
    • gi::VFT: Vector of inhibitory conductances
    source
    SNNModels.DoubleExpCurrentSynapseVarsType
    DoubleExpCurrentSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for double exponential current synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • ge::VFT: Vector of excitatory conductances
    • gi::VFT: Vector of inhibitory conductances
    • he::VFT: Vector of auxiliary variables for excitatory synapses
    • hi::VFT: Vector of auxiliary variables for inhibitory synapses
    source
    SNNModels.DoubleExpSynapseVarsType
    DoubleExpSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for double exponential synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • ge::VFT: Vector of excitatory conductances
    • gi::VFT: Vector of inhibitory conductances
    • he::VFT: Vector of auxiliary variables for excitatory synapses
    • hi::VFT: Vector of auxiliary variables for inhibitory synapses
    source
    SNNModels.ReceptorSynapseVarsType
    ReceptorSynapseVars{MFT} <: AbstractReceptorVariable

    A synaptic variable type that stores the state variables for receptor-based synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • g::MFT: Matrix of conductances for each receptor type
    • h::MFT: Matrix of auxiliary variables for each receptor type
    source
    SNNModels.SingleExpSynapseVarsType
    SingleExpSynapseVars{VFT} <: AbstractSynapseVariable

    A synaptic variable type that stores the state variables for single exponential synaptic dynamics.

    Fields

    • N::Int: Number of synapses
    • ge::VFT: Vector of excitatory conductances
    • gi::VFT: Vector of inhibitory conductances
    source