Synapse and receptor models

A synapse model turns the weights delivered by connections into a synaptic current. It is the field synapse of IF and AdEx (soma_syn, dend_syn of Tripod, BallAndStick); the target symbol of a connection picks the input (:ge, :he -> :glu; :gi, :hi -> :gaba; other names as given). The neuron equations subtract $I_{syn}$: conductance models give $I_{syn} = \sum_r g_r (V - E_r)$, current models $I_{syn} = -(g_e - g_i)$; weights are positive.

Summary

ModelTypeVariablesIntegrationWorks with
DeltaSynapsecurrent, instantaneousge, ginone (one-step pulse)IF, AdEx, ExtendedIF
CurrentSynapsecurrent, single exponentialge, giforward Eulerpoint neurons, dendritic neurons
SingleExpSynapseconductance, single exponentialge, giforward Eulerpoint neurons, dendritic neurons
DoubleExpSynapseconductance, rise and decayge, gi, he, hiforward Eulerall (default of IF, AdEx)
DoubleExpCurrentSynapsecurrent, rise and decayge, gi, he, hiforward Eulerall
ReceptorSynapseconductance, list of receptors, NMDA blockg, h (N x n_rec)exponential Eulerall (default of Tripod, BallAndStick)
MultiReceptorSynapseas ReceptorSynapse, one input per receptor groupg, hexponential Eulerpoint neurons, dendritic neurons
Confavreux2025Synapseconductance, AMPA + filtered NMDA + GABAgAMPA, gNMDA, gGABAforward Eulerall

Delta synapse

No parameters; the weights of the previous step act as a current for one step:

\[I_{syn}(t) = -\left(\sum_{k \in \text{exc}} w_k - \sum_{k \in \text{inh}} w_k\right).\]

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS), synapse = SNN.DeltaSynapse())
SNNModels.DeltaSynapse — Type
DeltaSynapse()

Instantaneous (delta) current synapse. The sum of the weights of the spikes received during the previous step is applied as a current during one integration step and then discarded.

Equations

\[I_{syn}(t) = -\left(\sum_{k \in \text{exc}} w_k - \sum_{k \in \text{inh}} w_k\right)\]

where the sums run over the spikes delivered since the previous step. The struct has no fields.

Integration

update_synapses! adds the receptor buffers to ge, gi and zeroes the buffers; synaptic_current!(p, synapse, synvars) sets syn_curr = -(ge - gi) and resets ge and gi to zero. With the forward Euler membrane update $V \mathrel{+}= \frac{dt}{\tau_m} R (\ldots - I_{syn})$ of IF, a weight w therefore produces a voltage jump of $R\,w\,dt/\tau_m$, which depends on dt.

DeltaSynapse works with the generalized IF point neurons (IF, AdEx, ExtendedIF) only. Tripod and BallAndStick call the five-argument synaptic_current!, which raises an ArgumentError for DeltaSynapse (use a conductance-based synapse such as ReceptorSynapse).

State variables: DeltaSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS), synapse = SNN.DeltaSynapse())
source
SNNModels.DeltaSynapseVars — Type
DeltaSynapseVars{VFT} <: AbstractSynapseVariable

State variables of DeltaSynapse, created by synaptic_variables(::DeltaSynapse, N).

Fields

  • N::Int = 100: number of neurons.
  • ge::VFT: excitatory input accumulated for the current step (pA).
  • gi::VFT: inhibitory input accumulated for the current step (pA).
source

Current synapse

Single-exponential current-based synapse.

\[\frac{dg_e}{dt} = -\frac{g_e}{\tau_e} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_i}{dt} = -\frac{g_i}{\tau_i} + \sum_k w_k\,\delta(t - t_k), \qquad I_{syn} = -(g_e - g_i)\]

FieldDefaultUnitsMeaning
τe6msmsdecay time constant of the excitatory current
τi2msmsdecay time constant of the inhibitory current
using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.CurrentSynapse(τe = 5ms, τi = 10ms))
SNNModels.CurrentSynapse — Type
CurrentSynapse(; τe = 6ms, τi = 2ms)

Current-based synapse with single-exponential kinetics for the excitatory (glu) and the inhibitory (gaba) inputs.

The weights of the presynaptic spikes are added instantaneously to the synaptic variables $g_e$ and $g_i$, which then decay exponentially. They are currents (pA), not conductances: the synaptic current does not depend on the membrane potential.

Equations

\[\frac{dg_e}{dt} = -\frac{g_e}{\tau_e} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_i}{dt} = -\frac{g_i}{\tau_i} + \sum_k w_k\,\delta(t - t_k)\]

\[I_{syn} = -(g_e - g_i)\]

so that with the neuron convention $C\,dV/dt = \ldots - I_{syn}$ excitation depolarises and inhibition hyperpolarises (inhibitory weights are positive).

Integration

At each step the accumulated input is added (ge += glu, gi += gaba), then one forward Euler step of the decay is applied (ge += -dt ge / τe). The receptor buffers are then zeroed.

Fields

  • τe::FT = 6ms: decay time constant of the excitatory current (ms).
  • τi::FT = 2ms: decay time constant of the inhibitory current (ms).

FT defaults to Float32. State variables: CurrentSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.CurrentSynapse(τe = 5ms, τi = 10ms))
source
SNNModels.CurrentSynapseVars — Type
CurrentSynapseVars{VFT} <: AbstractSynapseVariable

State variables of CurrentSynapse, created by synaptic_variables(::CurrentSynapse, N).

Fields

  • N::Int = 100: number of neurons.
  • ge::VFT: excitatory synaptic current (pA), one entry per neuron.
  • gi::VFT: inhibitory synaptic current (pA), one entry per neuron.
source

Single-exponential conductance synapse

\[\frac{dg_e}{dt} = -\frac{g_e}{\tau_e} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_i}{dt} = -\frac{g_i}{\tau_i} + \sum_k w_k\,\delta(t - t_k)\]

\[I_{syn} = g_{syn,e}\, g_e\,(V - E_e) + g_{syn,i}\, g_i\,(V - E_i)\]

FieldDefaultUnitsMeaning
τe6msmsexcitatory decay time constant
τi0.5msmsinhibitory decay time constant
E_i-75mVmVinhibitory reversal potential
E_e0mVmVexcitatory reversal potential
gsyn_e1.0-excitatory conductance scaling (weights in nS)
gsyn_i1.0-inhibitory conductance scaling
using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.SingleExpSynapse(τe = 5ms, τi = 10ms))
SNNModels.SingleExpSynapse — Type
SingleExpSynapse(; τe = 6ms, τi = 0.5ms, E_i = -75mV, E_e = 0mV, gsyn_e = 1, gsyn_i = 1)

Conductance-based synapse with single-exponential kinetics, one excitatory and one inhibitory conductance per neuron.

Equations

\[\frac{dg_e}{dt} = -\frac{g_e}{\tau_e} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_i}{dt} = -\frac{g_i}{\tau_i} + \sum_k w_k\,\delta(t - t_k)\]

\[I_{syn} = g_{syn,e}\, g_e\,(V - E_e) + g_{syn,i}\, g_i\,(V - E_i)\]

Integration

The accumulated input is added to ge/gi, then one forward Euler step of the decay is applied (ge += -dt ge / τe, gi += -dt gi / τi). The receptor buffers are then zeroed.

Fields

  • τe::FT = 6ms: decay time constant of the excitatory conductance (ms).
  • τi::FT = 0.5ms: decay time constant of the inhibitory conductance (ms).
  • E_i::FT = -75mV: inhibitory reversal potential (mV).
  • E_e::FT = 0mV: excitatory reversal potential (mV).
  • gsyn_e::FT = 1.0: scaling of the excitatory conductance (dimensionless; weights are in nS).
  • gsyn_i::FT = 1.0: scaling of the inhibitory conductance (dimensionless).

FT defaults to Float32. State variables: SingleExpSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.SingleExpSynapse(τe = 5ms, τi = 10ms))
source
SNNModels.SingleExpSynapseVars — Type
SingleExpSynapseVars{VFT} <: AbstractSynapseVariable

State variables of SingleExpSynapse, created by synaptic_variables(::SingleExpSynapse, N).

Fields

  • N::Int = 100: number of neurons.
  • ge::VFT: excitatory conductance (nS).
  • gi::VFT: inhibitory conductance (nS).
source

Double-exponential conductance synapse

Default of IF and AdEx:

\[\frac{dh_e}{dt} = -\frac{h_e}{\tau_{re}} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_e}{dt} = -\frac{g_e}{\tau_{de}} + h_e\]

(same for $h_i, g_i$), $I_{syn} = g_{syn,e} g_e (V - E_e) + g_{syn,i} g_i (V - E_i)$.

FieldDefaultUnitsMeaning
τre1msmsexcitatory rise time constant
τde6msmsexcitatory decay time constant
τri0.5msmsinhibitory rise time constant
τdi2msmsinhibitory decay time constant
E_i-75mVmVinhibitory reversal potential
E_e0mVmVexcitatory reversal potential
gsyn_e1.0-excitatory conductance scaling
gsyn_i1.0-inhibitory conductance scaling
using SpikingNeuralNetworks
SNN.@load_units
syn = SNN.DoubleExpSynapse(τre = 1ms, τde = 6ms, τri = 0.5ms, τdi = 2ms)
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS), synapse = syn)
SNNModels.DoubleExpSynapse — Type
DoubleExpSynapse(; τre = 1ms, τde = 6ms, τri = 0.5ms, τdi = 2ms,
                   E_i = -75mV, E_e = 0mV, gsyn_e = 1, gsyn_i = 1)

Conductance-based synapse with double-exponential (rise and decay) kinetics, one excitatory and one inhibitory conductance per neuron. This is the default synapse of IF and AdEx.

Equations

Each spike increments the auxiliary variable $h$, which drives the conductance $g$:

\[\frac{dh_e}{dt} = -\frac{h_e}{\tau_{re}} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_e}{dt} = -\frac{g_e}{\tau_{de}} + h_e\]

(same for $h_i, g_i$ with $\tau_{ri}, \tau_{di}$), and

\[I_{syn} = g_{syn,e}\, g_e\,(V - E_e) + g_{syn,i}\, g_i\,(V - E_i).\]

The kernel is not normalised: a unit jump of $h$ gives a conductance time course $\frac{\tau_r \tau_d}{\tau_d - \tau_r}\left(e^{-t/\tau_d} - e^{-t/\tau_r}\right)$.

Integration

Forward Euler: the input is added to he/hi; then ge += dt (-ge/τde + he) (using the updated he) and he += -dt he / τre (same for the inhibitory pair). The receptor buffers are then zeroed.

Fields

  • τre::FT = 1ms: rise time constant, excitatory (ms).
  • τde::FT = 6ms: decay time constant, excitatory (ms).
  • τri::FT = 0.5ms: rise time constant, inhibitory (ms).
  • τdi::FT = 2ms: decay time constant, inhibitory (ms).
  • E_i::FT = -75mV: inhibitory reversal potential (mV).
  • E_e::FT = 0mV: excitatory reversal potential (mV).
  • gsyn_e::FT = 1.0: scaling of the excitatory conductance (dimensionless).
  • gsyn_i::FT = 1.0: scaling of the inhibitory conductance (dimensionless).

FT defaults to Float32. State variables: DoubleExpSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
syn = SNN.DoubleExpSynapse(τre = 1ms, τde = 6ms, τri = 0.5ms, τdi = 2ms)
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS), synapse = syn)
source
SNNModels.DoubleExpSynapseVars — Type
DoubleExpSynapseVars{VFT} <: AbstractSynapseVariable

State variables of DoubleExpSynapse, created by synaptic_variables(::DoubleExpSynapse, N).

Fields

  • N::Int = 100: number of neurons.
  • ge::VFT: excitatory conductance (nS).
  • gi::VFT: inhibitory conductance (nS).
  • he::VFT: excitatory rise (auxiliary) variable (nS/ms).
  • hi::VFT: inhibitory rise (auxiliary) variable (nS/ms).
source

Double-exponential current synapse

Same kinetics as DoubleExpSynapse, but ge and gi are currents (pA) and $I_{syn} = -(g_e - g_i)$. Fields: τre = 1ms, τde = 6ms, τri = 0.5ms, τdi = 2ms.

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.DoubleExpCurrentSynapse())
SNNModels.DoubleExpCurrentSynapse — Type
DoubleExpCurrentSynapse(; τre = 1ms, τde = 6ms, τri = 0.5ms, τdi = 2ms)

Current-based synapse with double-exponential (rise and decay) kinetics. Same kinetics as DoubleExpSynapse, but ge and gi are currents (pA) and do not depend on the membrane potential.

Equations

\[\frac{dh_e}{dt} = -\frac{h_e}{\tau_{re}} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_e}{dt} = -\frac{g_e}{\tau_{de}} + h_e\]

(same for the inhibitory pair), and $I_{syn} = -(g_e - g_i)$.

Integration

Forward Euler, in the same order as DoubleExpSynapse (input into he/hi, update ge/gi with the new he/hi, then decay he/hi). The receptor buffers are then zeroed.

Fields

  • τre::FT = 1ms: rise time constant, excitatory (ms).
  • τde::FT = 6ms: decay time constant, excitatory (ms).
  • τri::FT = 0.5ms: rise time constant, inhibitory (ms).
  • τdi::FT = 2ms: decay time constant, inhibitory (ms).

FT defaults to Float32. State variables: DoubleExpCurrentSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.DoubleExpCurrentSynapse())
source
SNNModels.DoubleExpCurrentSynapseVars — Type
DoubleExpCurrentSynapseVars{VFT} <: AbstractSynapseVariable

State variables of DoubleExpCurrentSynapse.

Fields

  • N::Int = 100: number of neurons.
  • ge::VFT: excitatory synaptic current (pA).
  • gi::VFT: inhibitory synaptic current (pA).
  • he::VFT: excitatory rise (auxiliary) variable (pA/ms).
  • hi::VFT: inhibitory rise (auxiliary) variable (pA/ms).
source

Receptor-based synapses

A list of receptors (Receptor), each with its kinetics, reversal potential, peak conductance $g_0$ and an optional NMDA magnesium block:

\[\frac{dh_r}{dt} = -\frac{h_r}{\tau_r} + \alpha_r \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_r}{dt} = -\frac{g_r}{\tau_d} + h_r, \qquad \alpha_r = \frac{1}{\tau_r} - \frac{1}{\tau_d}\]

with $g_{syn} = g_0\,\mathrm{norm\_synapse}(\tau_r, \tau_d)$ (a unit weight peaks at $g_0$ nS) and

\[I_{syn} = \sum_r g_{syn,r}\, g_r\,(V - E_{rev,r})\, B_r(V), \qquad B_r(V) = \begin{cases} 1 & nmda_r = 0 \\ \left(1 + \frac{[\mathrm{Mg}]}{b}\, e^{k V}\right)^{-1} & \text{otherwise.} \end{cases}\]

$B$ (nmda_gating) is the Jahr and Stevens (1990) block.

Receptor fields

FieldDefaultUnitsMeaning
name"Receptor"label
E_rev0.0mVreversal potential
τr-1.0msrise time constant (non-positive means unset)
τd-1.0msdecay time constant (non-positive means unset)
g00.0nSpeak conductance per unit weight
nmda0.0non-zero enables the magnesium block
target:nonereceptor group, used by MultiReceptorSynapse

Receptors(...) builds a ReceptorArray.

NMDAVoltageDependency fields

FieldDefaultUnitsMeaning
b3.36mM
k-0.0771/mVvoltage sensitivity
mg1.0mMextracellular magnesium concentration

Defaults from Eyal et al. (2018) (SomaNMDA, EyalNMDA).

ReceptorSynapse

glu drives the receptors in glu_receptors, gaba those in gaba_receptors.

FieldDefaultMeaning
synSomaReceptorsReceptorArray
NMDANMDAVoltageDependency()magnesium block
glu_receptors[1, 2]indices driven by glu
gaba_receptors[3, 4]indices driven by gaba

MultiReceptorSynapse

Each receptor is driven by the input named by its target; a connection addresses a group by name.

using SpikingNeuralNetworks
SNN.@load_units
recs = SNN.Receptors(SNN.Receptor(E_rev = 0mV, τr = 0.5ms, τd = 3ms, g0 = 1nS, target = :AMPA),
                     SNN.Receptor(E_rev = -70mV, τr = 0.5ms, τd = 6ms, g0 = 1nS, target = :GABA))
P = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.MultiReceptorSynapse(recs))
E = SNN.Poisson(N = 20, param = SNN.PoissonParameter(10Hz))
EP = SNN.SpikingSynapse(E, P, :AMPA; conn = (p = 0.5, μ = 1.0))
SNN.sim!([E, P], [EP]; duration = 100ms)

Predefined receptor sets

E_rev in mV, time constants in ms, g0 in nS.

NameTypeReceptors (E_rev, τr, τd, g0)Indices
SomaReceptorsReceptorArrayAMPA (0, 1, 6, 0.7); NMDA (0, 1, 100, 0.15, block); GABAa (-70, 0.5, 10, 2.0); GABAb (-90, 30, 400, 0.006)
SomaSynapseReceptorSynapseSomaReceptors, NMDA = SomaNMDA (equal to ReceptorSynapse())glu [1, 2], gaba [3, 4]
TripodSomaSynapseReceptorSynapseAMPA (0, 0.26, 2.0, 0.73); GABAa (-70, 0.1, 15.0, 0.38); NMDA = EyalNMDAglu [1], gaba [2]
TripodDendSynapseReceptorSynapseAMPA (0, 0.26, 2.0, 0.73); NMDA (0, 8, 35, 1.31, block); GABAa (-70, 4.8, 29, 0.27); GABAb (-90, 30, 400, 0.006); NMDA = EyalNMDAglu [1, 2], gaba [3, 4]
SomaNMDA, EyalNMDANMDAVoltageDependencyb = 3.36, k = -0.077, mg = 1

Dendritic AMPA/NMDA: Eyal et al. (2018); GABA: Miles et al. (1996).

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.ReceptorSynapse())          # AMPA + NMDA + GABAa + GABAb
syn = SNN.ReceptorSynapse(SNN.SomaReceptors, SNN.SomaNMDA; glu_receptors = [1], gaba_receptors = [3])
SNN.nmda_gating(-70.0f0, SNN.SomaNMDA)
SNNModels.GABAergic — Type
GABAergic(; GABAa = Receptor(), GABAb = Receptor())
GABAergic(GABAa, GABAb)

Pair of GABAergic receptors (GABAa and GABAb), used with Glutamatergic in Receptors(glu, gaba).

Fields

  • GABAa::Receptor = Receptor(): fast GABAa receptor.
  • GABAb::Receptor = Receptor(): slow GABAb receptor.
source
SNNModels.Glutamatergic — Type
Glutamatergic(; AMPA = Receptor(), NMDA = ReceptorVoltage())
Glutamatergic(AMPA, NMDA)

Pair of glutamatergic receptors (AMPA and NMDA), used with GABAergic to build a four-receptor array via Receptors(glu, gaba).

Fields

  • AMPA::Receptor = Receptor(): AMPA receptor.
  • NMDA::Receptor = ReceptorVoltage(): NMDA receptor (set nmda = 1 to enable the magnesium block).
source
SNNModels.NMDAVoltageDependency — Type
NMDAVoltageDependency(; b = 3.36, k = -0.077, mg = 1.0)

Parameters of the voltage-dependent magnesium block of NMDA receptors. The block factor multiplying the current of every receptor with nmda != 0 is

\[B(V) = \frac{1}{1 + \frac{[\mathrm{Mg}]}{b}\, e^{k V}}\]

(see nmda_gating), the Jahr and Stevens form, with the values of Eyal et al. (2018).

Fields

  • b::T = 3.36: (mM).
  • k::T = -0.077: voltage sensitivity (1/mV).
  • mg::T = 1.0: extracellular magnesium concentration (mM).

T defaults to Float32. Predefined instances: SomaNMDA and EyalNMDA (both with the defaults).

References

Jahr C. E., Stevens C. F. (1990), J. Neurosci. (functional form of the block). Eyal G. et al. (2018), Human cortical pyramidal neurons: from spines to spikes via models, Front. Cell. Neurosci. 12, doi:10.3389/fncel.2018.00181.

Example

using SpikingNeuralNetworks
SNN.nmda_gating(-70.0f0, SNN.NMDAVoltageDependency())
source
SNNModels.Receptor — Type
Receptor(; name = "Receptor", E_rev = 0.0, τr = -1, τd = -1, g0 = 0, nmda = 0, target = :none)

Parameters of one synaptic receptor with double-exponential kinetics, used by ReceptorSynapse and MultiReceptorSynapse (and by the dendritic models through them). ReceptorVoltage is an alias of Receptor (used for NMDA receptors, nmda = 1).

The derived fields are computed from τr, τd and g0 by the keyword constructor and should not be passed by hand:

\[g_{syn} = g_0 \cdot \mathrm{norm\_synapse}(\tau_r, \tau_d), \qquad \alpha = \frac{\tau_d - \tau_r}{\tau_d \tau_r}, \qquad \tau_r^{-} = 1/\tau_r, \quad \tau_d^{-} = 1/\tau_d\]

so that a unit weight produces a conductance with peak $g_0$ (see ReceptorSynapse).

Fields

  • name::String = "Receptor": label.
  • E_rev::T = 0.0: reversal potential (mV).
  • τr::T = -1.0: rise time constant (ms); non-positive values mean "unset".
  • τd::T = -1.0: decay time constant (ms); non-positive values mean "unset".
  • g0::T = 0.0: peak conductance per unit weight (nS).
  • gsyn::T: g0 * norm_synapse(τr, τd) if g0 > 0, else 0 (nS).
  • α::T: α_synapse(τr, τd) = (τd - τr) / (τd τr) (1/ms).
  • τr⁻::T: 1/τr if positive, else 0 (1/ms).
  • τd⁻::T: 1/τd if positive, else 0 (1/ms).
  • nmda::T = 0.0: if non-zero the receptor current is multiplied by the NMDA magnesium block.
  • target::Symbol = :none: input group of the receptor, used by MultiReceptorSynapse (e.g. :glu, :gaba, :AMPA); ignored by ReceptorSynapse.

T defaults to Float32; Receptor(T = Float64, ...) computes the derived fields in Float64. convert_precision(r, Float64) of a predefined receptor (those of SomaSynapse, TripodSomaSynapse, TripodDendSynapse) rebuilds it from its decimal definition (τr = 0.26, derived fields in Float64); any other receptor is converted value by value.

Example

using SpikingNeuralNetworks
SNN.@load_units
AMPA = SNN.Receptor(E_rev = 0mV, τr = 0.26ms, τd = 2ms, g0 = 0.73nS, target = :glu)
NMDA = SNN.ReceptorVoltage(E_rev = 0mV, τr = 8ms, τd = 35ms, g0 = 1.31nS, nmda = 1, target = :glu)
AMPA.gsyn
source
SNNModels.ReceptorArray — Type
ReceptorArray = Vector{Receptor{Float32}}

Vector of receptors, the type of the syn field of ReceptorSynapse and MultiReceptorSynapse.

source
SNNModels.ReceptorVoltage — Type
ReceptorVoltage = Receptor

Alias of Receptor, used to mark voltage-dependent (NMDA) receptors, which are created with nmda = 1. It is not a distinct type.

source
SNNModels.Receptors — Function
Receptors(; AMPA = Receptor(), NMDA = ReceptorVoltage(), GABAa = Receptor(), GABAb = Receptor())
Receptors(AMPA, NMDA, GABAa, GABAb)
Receptors(glu::Glutamatergic, gaba::GABAergic)
Receptors(args...)

Build a ReceptorArray (Vector{Receptor{Float32}}). Receptors is a function, not a type. The four-receptor forms return [AMPA, NMDA, GABAa, GABAb], so that in a ReceptorSynapse the glutamatergic receptors have indices [1, 2] and the GABAergic ones [3, 4] (the default glu_receptors/gaba_receptors). The variadic form collects any number of receptors in the given order. The keyword defaults are the empty Receptor() (zero conductance), so all receptors are normally passed explicitly.

Example

using SpikingNeuralNetworks
SNN.@load_units
recs = SNN.Receptors(SNN.Receptor(E_rev = 0mV, τr = 1ms, τd = 6ms, g0 = 0.7nS, target = :glu),
                     SNN.Receptor(E_rev = -70mV, τr = 0.5ms, τd = 10ms, g0 = 2nS, target = :gaba))
length(recs)  # 2
source
SNNModels.Receptors — Method
Receptors(glu::Glutamatergic, gaba::GABAergic) -> ReceptorArray

Return [glu.AMPA, glu.NMDA, gaba.GABAa, gaba.GABAb].

source
SNNModels.infer_receptors — Method
infer_receptors(receptors::ReceptorArray)::NamedTuple

Infer receptor types and their indices from a ReceptorArray.

This function processes an array of receptors and returns a named tuple where each field corresponds to a receptor type (specified by the target field of each receptor). The value of each field is a vector of indices that reference the receptors of that type in the input array.

Arguments

  • receptors::ReceptorArray: An array of receptor objects to be processed

Returns

  • NamedTuple: A named tuple where each field name is a receptor type (Symbol) and the corresponding value is a vector of indices (Int) of receptors of that type in the input array

Errors

  • Logs an error (@error, it does not throw) if a receptor has target == :none; that receptor is then grouped under :none.

Example

using SpikingNeuralNetworks
receptors = SNN.ReceptorArray([
    SNN.Receptor(target = :glu),
    SNN.Receptor(target = :gaba),
    SNN.Receptor(target = :glu),
])
result = SNNModels.infer_receptors(receptors)
# result.glu == [1, 3], result.gaba == [2] (the order of the fields is not guaranteed)
source
SNNModels.nmda_gating — Method
nmda_gating(v, NMDA::NMDAVoltageDependency)

Magnesium block factor $B(v) = 1 / (1 + (mg/b)\, e^{k v})$ at membrane potential v (mV).

source
SNNModels.norm_synapse — Method
norm_synapse(τr, τd)

Inverse of the peak of the difference of exponentials $e^{-t/\tau_d} - e^{-t/\tau_r}$:

\[t_p = \frac{\tau_r \tau_d}{\tau_d - \tau_r}\ln\frac{\tau_d}{\tau_r}, \qquad \mathrm{norm\_synapse} = \left(e^{-t_p/\tau_d} - e^{-t_p/\tau_r}\right)^{-1}\]

Used to set gsyn = g0 * norm_synapse(τr, τd) in Receptor, so that g0 is the peak conductance per unit weight. Requires τd != τr, both positive.

Example

using SpikingNeuralNetworks
SNN.norm_synapse(0.26, 2.0)   # ≈ 1.559
source
SNNModels.norm_synapse — Method
norm_synapse(receptor::Receptor)

Normalisation factor of receptor, norm_synapse(receptor.τr, receptor.τd).

source
SNNModels.α_synapse — Method
α_synapse(τr, τd)

Return (τd - τr) / (τd * τr) (= 1/τr - 1/τd), the increment of the rise variable per unit weight in the receptor kinetics (see ReceptorSynapse).

source
SNNModels.EyalNMDA — Constant
EyalNMDA :: NMDAVoltageDependency{Float32}

NMDA magnesium block with mg = 1 mM, b = 3.36 mM, k = -0.077 1/mV (Eyal et al. 2018). Numerically identical to SomaNMDA.

source
SNNModels.SomaNMDA — Constant
SomaNMDA :: NMDAVoltageDependency{Float32}

Somatic NMDA magnesium block, equal to the NMDAVoltageDependency defaults (b = 3.36 mM, k = -0.077 1/mV, mg = 1 mM).

source
SNNModels.SomaReceptors — Constant
SomaReceptors :: ReceptorArray

Somatic receptor set [AMPA, NMDA, GABAa, GABAb], the default syn of ReceptorSynapse and MultiReceptorSynapse.

ReceptorE_rev (mV)τr (ms)τd (ms)g0 (nS)NMDA blocktarget
AMPA016.00.7no:glu
NMDA01100.00.15yes:glu
GABAa-700.510.02.0no:gaba
GABAb-9030400.00.006no:gaba
source
SNNModels.SomaSynapse — Constant
SomaSynapse :: ReceptorSynapse

ReceptorSynapse with syn = SomaReceptors, glu_receptors = [1, 2], gaba_receptors = [3, 4], NMDA = SomaNMDA; equal to ReceptorSynapse().

source
SNNModels.TripodDendSynapse — Constant
TripodDendSynapse :: ReceptorSynapse

Default dendritic synapse of Tripod and BallAndStick: a ReceptorSynapse with four receptors, glu_receptors = [1, 2], gaba_receptors = [3, 4], NMDA = EyalNMDA.

ReceptorE_rev (mV)τr (ms)τd (ms)g0 (nS)NMDA block
AMPA00.262.00.73no
NMDA0835.01.31yes
GABAa-704.829.00.27no
GABAb-9030400.00.006no

AMPA/NMDA parameters attributed to Eyal et al. (2018), Front. Cell. Neurosci. 12, doi:10.3389/fncel.2018.00181; GABA parameters to Miles et al. (1996), Neuron 16(4):815-823.

source
SNNModels.TripodSomaSynapse — Constant
TripodSomaSynapse :: ReceptorSynapse

Default somatic synapse of Tripod and BallAndStick: a ReceptorSynapse with two receptors, glu_receptors = [1], gaba_receptors = [2], NMDA = EyalNMDA.

ReceptorE_rev (mV)τr (ms)τd (ms)g0 (nS)
AMPA (DuarteGluSoma)00.262.00.73
GABAa (MilesGabaSoma)-700.115.00.38

The GABA parameters are attributed to Miles et al. (1996), Neuron 16(4):815-823; the AMPA parameters to "Duarte" (reference not given in the code).

source
SNNModels.MultiReceptorSynapse — Type
MultiReceptorSynapse(; syn = SomaReceptors, NMDA = NMDAVoltageDependency())
MultiReceptorSynapse(syn::ReceptorArray; kwargs...)

Receptor-based conductance synapse in which every receptor is driven by the input buffer named by its target field, instead of the fixed glu/gaba split of ReceptorSynapse. The receptors are grouped by target (infer_receptors) and the population gets one input buffer per distinct target, so a connection can address, for example, an :AMPA or a :GABAb group directly (SpikingSynapse(pre, post, :AMPA; conn)). All receptors must have target different from :none.

The kinetics, the NMDA block and the integration scheme are the same as ReceptorSynapse:

Equations

Each receptor $r$ (an entry of syn, see Receptor) has a conductance $g_r$ and an auxiliary rise variable $h_r$. A spike of weight $w$ arriving on the receptor group of $r$ increments $h_r$ by $\alpha_r w$ with $\alpha_r = 1/\tau_{r} - 1/\tau_{d}$:

\[\frac{dh_r}{dt} = -\frac{h_r}{\tau_{r}} + \alpha_r \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_r}{dt} = -\frac{g_r}{\tau_{d}} + h_r\]

With this choice a unit weight gives $g_r(t) = e^{-t/\tau_d} - e^{-t/\tau_r}$, whose peak is $1/\mathrm{norm\_synapse}(\tau_r, \tau_d)$; since $g_{syn} = g_0\,\mathrm{norm\_synapse}(\tau_r,\tau_d)$ the peak conductance of a unit weight is $g_0$ (nS). The synaptic current is

\[I_{syn} = \sum_r g_{syn,r}\, g_r\,(V - E_{rev,r})\, B_r(V), \qquad B_r(V) = \begin{cases} 1 & \text{if } nmda_r = 0 \\ \left(1 + \frac{[\mathrm{Mg}]}{b}\, e^{k V}\right)^{-1} & \text{otherwise}\end{cases}\]

where $b$, $k$ and $[\mathrm{Mg}]$ are the fields of the NMDAVoltageDependency stored in NMDA.

Integration

Exact exponential decay over one step (exponential Euler), receptor by receptor: h += α w; g = exp(-dt/τd) (g + dt h); h = exp(-dt/τr) h. The receptor buffers are then zeroed. The current is computed with the membrane potential at the beginning of the step.

Fields

  • syn::ST = SomaReceptors: vector of Receptor.
  • NMDA::NMDAT = NMDAVoltageDependency(): magnesium block parameters.
  • receptors::REC = infer_receptors(syn): NamedTuple mapping each target symbol to the indices of the receptors in syn (computed, normally not given).

The positional form MultiReceptorSynapse(syn; kwargs...) is equivalent to MultiReceptorSynapse(; syn, kwargs...). State variables: ReceptorSynapseVars.

Example

using SpikingNeuralNetworks
SNN.@load_units
recs = SNN.Receptors(SNN.Receptor(E_rev = 0mV, τr = 0.5ms, τd = 3ms, g0 = 1nS, target = :AMPA),
                     SNN.Receptor(E_rev = -70mV, τr = 0.5ms, τd = 6ms, g0 = 1nS, target = :GABA))
syn = SNN.MultiReceptorSynapse(recs)
P = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS), synapse = syn)
keys(P.receptors)   # (:GABA, :AMPA)
source
SNNModels.ReceptorSynapse — Type
ReceptorSynapse(; syn = SomaReceptors, NMDA = NMDAVoltageDependency(),
                  glu_receptors = [1, 2], gaba_receptors = [3, 4])
ReceptorSynapse(syn::ReceptorArray, NMDA::NMDAVoltageDependency{Float32}; kwargs...)

Conductance-based synapse built from an arbitrary list of receptors (Receptor), each with its own rise and decay time constants, peak conductance and reversal potential, and optional NMDA magnesium block. Spikes arriving on the glu input drive the receptors listed in glu_receptors, spikes on the gaba input drive those in gaba_receptors.

Equations

Each receptor $r$ (an entry of syn, see Receptor) has a conductance $g_r$ and an auxiliary rise variable $h_r$. A spike of weight $w$ arriving on the receptor group of $r$ increments $h_r$ by $\alpha_r w$ with $\alpha_r = 1/\tau_{r} - 1/\tau_{d}$:

\[\frac{dh_r}{dt} = -\frac{h_r}{\tau_{r}} + \alpha_r \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_r}{dt} = -\frac{g_r}{\tau_{d}} + h_r\]

With this choice a unit weight gives $g_r(t) = e^{-t/\tau_d} - e^{-t/\tau_r}$, whose peak is $1/\mathrm{norm\_synapse}(\tau_r, \tau_d)$; since $g_{syn} = g_0\,\mathrm{norm\_synapse}(\tau_r,\tau_d)$ the peak conductance of a unit weight is $g_0$ (nS). The synaptic current is

\[I_{syn} = \sum_r g_{syn,r}\, g_r\,(V - E_{rev,r})\, B_r(V), \qquad B_r(V) = \begin{cases} 1 & \text{if } nmda_r = 0 \\ \left(1 + \frac{[\mathrm{Mg}]}{b}\, e^{k V}\right)^{-1} & \text{otherwise}\end{cases}\]

where $b$, $k$ and $[\mathrm{Mg}]$ are the fields of the NMDAVoltageDependency stored in NMDA.

Integration

Exact exponential decay over one step (exponential Euler), receptor by receptor: h += α w; g = exp(-dt/τd) (g + dt h); h = exp(-dt/τr) h. The receptor buffers are then zeroed. The current is computed with the membrane potential at the beginning of the step.

Fields

  • syn::ST = SomaReceptors: vector of Receptor (a ReceptorArray); the default is the somatic AMPA, NMDA, GABAa, GABAb set SomaReceptors.
  • NMDA::NMDAT = NMDAVoltageDependency(): parameters of the magnesium block ($b = 3.36$, $k = -0.077$ 1/mV, $[\mathrm{Mg}] = 1$ mM).
  • glu_receptors::VIT = [1, 2]: indices in syn driven by the glu input.
  • gaba_receptors::VIT = [3, 4]: indices in syn driven by the gaba input.

Type parameters: VIT = Vector{Int}, ST = Vector{Receptor{Float32}}, NMDAT = NMDAVoltageDependency{Float32}. State variables: ReceptorSynapseVars. Input buffers: (glu, gaba), so connections target :glu/:ge/:he or :gaba/:gi/:hi.

Predefined instances: SomaSynapse, TripodSomaSynapse, TripodDendSynapse.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.ReceptorSynapse())          # AMPA + NMDA + GABAa + GABAb
syn = SNN.ReceptorSynapse(SNN.SomaReceptors, SNN.SomaNMDA; glu_receptors = [1], gaba_receptors = [3])
source
SNNModels.ReceptorSynapseVars — Type
ReceptorSynapseVars{MFT} <: AbstractReceptorVariable

State variables of ReceptorSynapse and MultiReceptorSynapse, created by synaptic_variables(synapse, N) with one column per receptor of synapse.syn.

Fields

  • N::Int = 100: number of neurons.
  • g::MFT = zeros(Float32, N, 4): conductances (before scaling by gsyn), N x n_receptors.
  • h::MFT = zeros(Float32, N, 4): auxiliary rise variables, N x n_receptors.
source

Confavreux 2025 synapse

NMDA is a low-pass filtered copy of AMPA; no magnesium block.

\[\frac{dg_{AMPA}}{dt} = -\frac{g_{AMPA}}{\tau_{AMPA}} + \sum_k w_k \delta(t - t_k), \qquad \frac{dg_{GABA}}{dt} = -\frac{g_{GABA}}{\tau_{GABA}} + \sum_k w_k \delta(t - t_k), \qquad \tau_{NMDA}\frac{dg_{NMDA}}{dt} = g_{AMPA} - g_{NMDA}\]

\[I_{syn} = \left(\alpha\, g_{AMPA} + (1-\alpha)\, g_{NMDA}\right)(V - E_e) + g_{GABA}\,(V - E_i)\]

FieldDefaultUnitsMeaning
τAMPA5msmsAMPA decay time constant
τNMDA100msmsNMDA filter time constant
τGABA10msmsGABA decay time constant
E_i-80mVmVinhibitory reversal potential
E_e0mVmVexcitatory reversal potential
α0.23-AMPA fraction of the excitatory conductance
using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.Confavreux2025Synapse())
SNNModels.Confavreux2025Synapse — Type
Confavreux2025Synapse(; τAMPA = 5ms, τNMDA = 100ms, τGABA = 10ms,
                        E_i = -80mV, E_e = 0mV, α = 0.23)

Conductance-based synapse with an AMPA, a slow NMDA-like and a GABA conductance, in which the NMDA conductance is a low-pass filtered copy of the AMPA conductance and excitation is a fixed mixture of the two. There is no magnesium block.

Equations

\[\frac{dg_{AMPA}}{dt} = -\frac{g_{AMPA}}{\tau_{AMPA}} + \sum_k w_k\,\delta(t - t_k), \qquad \frac{dg_{GABA}}{dt} = -\frac{g_{GABA}}{\tau_{GABA}} + \sum_k w_k\,\delta(t - t_k), \qquad \tau_{NMDA}\frac{dg_{NMDA}}{dt} = g_{AMPA} - g_{NMDA}\]

\[I_{syn} = \left(\alpha\, g_{AMPA} + (1-\alpha)\, g_{NMDA}\right)(V - E_e) + g_{GABA}\,(V - E_i)\]

where the sums run over the excitatory (resp. inhibitory) spikes received, with weights $w_k$ (nS): a spike of weight $w$ increments the conductance by $w$, as in the other synapse models.

Integration

Forward Euler, in this order: gAMPA += -dt gAMPA/τAMPA + glu, gGABA += -dt gGABA/τGABA + gaba (glu, gaba: sum of the weights received in the step), gNMDA += dt (gAMPA - gNMDA)/τNMDA (with the updated gAMPA).

Changed after SNNModels 1.8.4

Up to 1.8.4 the input entered multiplied by dt (gAMPA += dt (-gAMPA/τAMPA + glu)), so a spike of weight w incremented the conductance by w dt: synaptic efficacy was proportional to dt (8 times smaller than w at the default dt = 0.125ms).

Fields

  • τAMPA::FT = 5ms: decay time constant of the AMPA conductance (ms).
  • τNMDA::FT = 100ms: time constant of the NMDA low-pass filter (ms).
  • τGABA::FT = 10ms: decay time constant of the GABA conductance (ms).
  • E_i::FT = -80mV: inhibitory reversal potential (mV).
  • E_e::FT = 0mV: excitatory reversal potential (mV).
  • α::FT = 0.23: fraction of the excitatory conductance carried by AMPA (the NMDA share is $1 - \alpha$).

FT defaults to Float32. State variables: Confavreux2025SynapseVars.

References

The name refers to Confavreux et al. (2025); the full reference is not given in the code.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.IF(N = 10, param = SNN.IFParameter(C = 281pF, gl = 40nS),
           synapse = SNN.Confavreux2025Synapse())
source
SNNModels.Confavreux2025SynapseVars — Type
Confavreux2025SynapseVars{VFT} <: AbstractSynapseVariable

State variables of Confavreux2025Synapse.

Fields

  • N::Int = 100: number of neurons.
  • gAMPA::VFT: AMPA conductance (nS).
  • gNMDA::VFT: NMDA conductance (nS).
  • gGABA::VFT: GABA conductance (nS).
source

Interface and generic functions

SNNModels.AbstractSynapseParameter — Type
AbstractSynapseParameter <: AbstractComponent

Supertype of the synapse models used by point-neuron populations (IF, AdEx, ExtendedIF, ...) and by the compartments of multicompartment populations (Tripod, BallAndStick).

A synapse model is a parameter struct that is stored in the population (field synapse, or soma_syn/dend_syn for dendritic models). It defines how the spikes delivered by the connections are turned into a synaptic current. Each population owns three objects created from it:

  • receptors::NamedTuple (built by synaptic_receptors): one vector (Float32 by default) of length N per receptor group, by default (glu = ..., gaba = ...). Connections (SpikingSynapse) add the weight of every presynaptic spike to the entry of the postsynaptic neuron in forward!.
  • synvars::AbstractSynapseVariable (built by synaptic_variables): the state variables (conductances, auxiliary rise variables) of the synapse model.
  • the current vector syn_curr (or the columns of is in dendritic models), written by synaptic_current!.

At every integrate! step the population calls, in order, update_synapses! (move the content of receptors into the synaptic state, integrate the state over dt, then zero the receptors buffers) and synaptic_current! (compute the current from the state and the membrane potential). The neuron equations use the sign convention $C\,dV/dt = \ldots - I_{syn}$, so a positive syn_curr hyperpolarises.

Interface to implement for a new synapse model

  • synaptic_variables(synapse, N, FT) returning an AbstractSynapseVariable with state of element type FT;
  • synaptic_receptors(synapse, N, FT) (optional, default (glu = zeros(FT, N), gaba = zeros(FT, N)));
  • update_synapses!(p, synapse, receptors, synvars, dt);
  • synaptic_current!(p, synapse, synvars, v, syn_curr).

Available models

DeltaSynapse, CurrentSynapse, SingleExpSynapse, DoubleExpSynapse, DoubleExpCurrentSynapse, ReceptorSynapse, MultiReceptorSynapse, Confavreux2025Synapse.

source
SNNModels.AbstractSynapseVariable — Type
AbstractSynapseVariable <: AbstractComponent

Supertype of the state containers of the synapse models (one container per population or per compartment, created by synaptic_variables(synapse, N)).

Available subtypes

  • DeltaSynapseVars (for DeltaSynapse): ge, gi
  • CurrentSynapseVars (for CurrentSynapse): ge, gi
  • SingleExpSynapseVars (for SingleExpSynapse): ge, gi
  • DoubleExpSynapseVars (for DoubleExpSynapse): ge, gi, he, hi
  • DoubleExpCurrentSynapseVars (for DoubleExpCurrentSynapse): ge, gi, he, hi
  • ReceptorSynapseVars (for ReceptorSynapse and MultiReceptorSynapse, via the abstract AbstractReceptorVariable): matrices g, h of size N x n_receptors
  • Confavreux2025SynapseVars (for Confavreux2025Synapse): gAMPA, gNMDA, gGABA

The state variables have the precision of the population (Float32 by default, Float64 for a population built with VFT = Vector{Float64}).

source
SNNModels.get_synapse_symbol — Method
get_synapse_symbol(synapse::AbstractSynapseParameter, sym::Symbol) -> Symbol

Map the receptor symbol given to a connection (e.g. SpikingSynapse(pre, post, :ge)) to the name of the receptor buffer of the postsynaptic population. The aliases :ge and :he map to :glu, and :gi and :hi map to :gaba; any other symbol (e.g. :glu, :gaba, or a receptor group name of a MultiReceptorSynapse such as :AMPA) is returned unchanged.

source
SNNModels.synaptic_current! — Method
synaptic_current!(p, synapse, synvars, v::AbstractVector, syn_curr::AbstractVector)
synaptic_current!(p, synapse, synvars)

Write into syn_curr the synaptic current (pA) of every neuron of p, computed from the synaptic state synvars and the membrane potential v (mV). Conductance-based models return $\sum_r g_r (V - E_r)$, current-based models return $-(g_e - g_i)$; the neuron equations subtract syn_curr. The three-argument form, used by generalized IF populations, reads v and syn_curr from the population fields p.v and p.syn_curr.

The fallback method defined in this file (for AbstractSinExpParameter) only throws an error.

source
SNNModels.synaptic_receptors — Method
synaptic_receptors(synapse::AbstractSynapseParameter, N::Int[, FT]) -> NamedTuple

Allocate the spike-input buffers of a population: a NamedTuple of Vector{FT} of length N, one per receptor group. The default is (glu = zeros(FT, N), gaba = zeros(FT, N)); MultiReceptorSynapse creates one buffer per distinct receptor target. Connections add their weights into these buffers and update_synapses! empties them at every step. FT defaults to float_type(synapse).

source
SNNModels.synaptic_variables — Method
synaptic_variables(synapse::AbstractSynapseParameter, N::Int[, FT]) -> AbstractSynapseVariable

Allocate the state variables (all zero, element type FT, default float_type(synapse)) of the synapse model synapse for N neurons or compartments. Every synapse model implements the three-argument method.

source
SNNModels.update_synapses! — Method
update_synapses!(p, synapse, receptors::NamedTuple, synvars::AbstractSynapseVariable, dt::Float32)

Advance the synaptic state synvars of population p by one time step dt: add the input accumulated since the previous step in the receptors buffers (sum of the weights of the presynaptic spikes, written by the connections), integrate the synaptic kinetics, and reset the buffers to zero. Each synapse model provides a method; see the docstring of the model for the equations and the integration scheme.

The method with signature (p, synapse, glu, gaba, synvars, dt) defined in this file is a legacy fallback that only throws an error.

source
SNNModels.synaptic_target — Function
synaptic_target(targets::Dict, post::AbstractPopulation, sym::Symbol, target = nothing) -> (g, v_post)

Resolve where a connection onto post delivers its spikes. Called by the connection constructors (e.g. SpikingSynapse(pre, post, sym, target; conn)); each population type implements a method.

Returns the input buffer g (a Vector{Float32} of length post.N, into which forward! adds the weights of the presynaptic spikes) and the membrane potential vector v_post of the target compartment (used by voltage-dependent plasticity rules). It also records in targets the entry :sym (name of the target, e.g. :glu or "glu_d1") used by print_model/graph.

  • Generalized IF point neurons (IF, AdEx, ...): sym is mapped by get_synapse_symbol (:ge, :he -> :glu; :gi, :hi -> :gaba; other symbols unchanged, e.g. the receptor groups of a MultiReceptorSynapse) and g = post.receptors.<sym>; target is ignored.
  • Dendritic neurons (Tripod, BallAndStick): target is the compartment symbol (:s, :d1, :d2 for Tripod; :s, :d for BallAndStick), g is the buffer post.receptors_<target>.<sym> and v_post = post.v_<target>.

Example

using SpikingNeuralNetworks
SNN.@load_units
E = SNN.Poisson(N = 10, param = SNN.PoissonParameter(10Hz))
T = SNN.Tripod(N = 5)
syn = SNN.SpikingSynapse(E, T, :glu, :d1; conn = (p = 0.5, μ = 1.0))
syn.targets[:sym]   # "glu_d1"
source