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
| Model | Type | Variables | Integration | Works with |
|---|---|---|---|---|
DeltaSynapse | current, instantaneous | ge, gi | none (one-step pulse) | IF, AdEx, ExtendedIF |
CurrentSynapse | current, single exponential | ge, gi | forward Euler | point neurons, dendritic neurons |
SingleExpSynapse | conductance, single exponential | ge, gi | forward Euler | point neurons, dendritic neurons |
DoubleExpSynapse | conductance, rise and decay | ge, gi, he, hi | forward Euler | all (default of IF, AdEx) |
DoubleExpCurrentSynapse | current, rise and decay | ge, gi, he, hi | forward Euler | all |
ReceptorSynapse | conductance, list of receptors, NMDA block | g, h (N x n_rec) | exponential Euler | all (default of Tripod, BallAndStick) |
MultiReceptorSynapse | as ReceptorSynapse, one input per receptor group | g, h | exponential Euler | point neurons, dendritic neurons |
Confavreux2025Synapse | conductance, AMPA + filtered NMDA + GABA | gAMPA, gNMDA, gGABA | forward Euler | all |
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())SNNModels.DeltaSynapseVars — Type
DeltaSynapseVars{VFT} <: AbstractSynapseVariableState 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).
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)\]
| Field | Default | Units | Meaning |
|---|---|---|---|
τe | 6ms | ms | decay time constant of the excitatory current |
τi | 2ms | ms | decay 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))SNNModels.CurrentSynapseVars — Type
CurrentSynapseVars{VFT} <: AbstractSynapseVariableState 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.
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)\]
| Field | Default | Units | Meaning |
|---|---|---|---|
τe | 6ms | ms | excitatory decay time constant |
τi | 0.5ms | ms | inhibitory decay time constant |
E_i | -75mV | mV | inhibitory reversal potential |
E_e | 0mV | mV | excitatory reversal potential |
gsyn_e | 1.0 | - | excitatory conductance scaling (weights in nS) |
gsyn_i | 1.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))SNNModels.SingleExpSynapseVars — Type
SingleExpSynapseVars{VFT} <: AbstractSynapseVariableState 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).
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)$.
| Field | Default | Units | Meaning |
|---|---|---|---|
τre | 1ms | ms | excitatory rise time constant |
τde | 6ms | ms | excitatory decay time constant |
τri | 0.5ms | ms | inhibitory rise time constant |
τdi | 2ms | ms | inhibitory decay time constant |
E_i | -75mV | mV | inhibitory reversal potential |
E_e | 0mV | mV | excitatory reversal potential |
gsyn_e | 1.0 | - | excitatory conductance scaling |
gsyn_i | 1.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)SNNModels.DoubleExpSynapseVars — Type
DoubleExpSynapseVars{VFT} <: AbstractSynapseVariableState 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).
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())SNNModels.DoubleExpCurrentSynapseVars — Type
DoubleExpCurrentSynapseVars{VFT} <: AbstractSynapseVariableState 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).
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
| Field | Default | Units | Meaning |
|---|---|---|---|
name | "Receptor" | label | |
E_rev | 0.0 | mV | reversal potential |
τr | -1.0 | ms | rise time constant (non-positive means unset) |
τd | -1.0 | ms | decay time constant (non-positive means unset) |
g0 | 0.0 | nS | peak conductance per unit weight |
nmda | 0.0 | non-zero enables the magnesium block | |
target | :none | receptor group, used by MultiReceptorSynapse |
Receptors(...) builds a ReceptorArray.
NMDAVoltageDependency fields
| Field | Default | Units | Meaning |
|---|---|---|---|
b | 3.36 | mM | |
k | -0.077 | 1/mV | voltage sensitivity |
mg | 1.0 | mM | extracellular magnesium concentration |
Defaults from Eyal et al. (2018) (SomaNMDA, EyalNMDA).
ReceptorSynapse
glu drives the receptors in glu_receptors, gaba those in gaba_receptors.
| Field | Default | Meaning |
|---|---|---|
syn | SomaReceptors | ReceptorArray |
NMDA | NMDAVoltageDependency() | 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.
| Name | Type | Receptors (E_rev, τr, τd, g0) | Indices |
|---|---|---|---|
SomaReceptors | ReceptorArray | AMPA (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) | |
SomaSynapse | ReceptorSynapse | SomaReceptors, NMDA = SomaNMDA (equal to ReceptorSynapse()) | glu [1, 2], gaba [3, 4] |
TripodSomaSynapse | ReceptorSynapse | AMPA (0, 0.26, 2.0, 0.73); GABAa (-70, 0.1, 15.0, 0.38); NMDA = EyalNMDA | glu [1], gaba [2] |
TripodDendSynapse | ReceptorSynapse | AMPA (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 = EyalNMDA | glu [1, 2], gaba [3, 4] |
SomaNMDA, EyalNMDA | NMDAVoltageDependency | b = 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.
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 (setnmda = 1to enable the magnesium block).
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())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)ifg0 > 0, else0(nS).α::T:α_synapse(τr, τd) = (τd - τr) / (τd τr)(1/ms).τr⁻::T:1/τrif positive, else0(1/ms).τd⁻::T:1/τdif positive, else0(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 byMultiReceptorSynapse(e.g.:glu,:gaba,:AMPA); ignored byReceptorSynapse.
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.gsynSNNModels.ReceptorArray — Type
ReceptorArray = Vector{Receptor{Float32}}Vector of receptors, the type of the syn field of ReceptorSynapse and MultiReceptorSynapse.
SNNModels.ReceptorVoltage — Type
ReceptorVoltage = ReceptorAlias of Receptor, used to mark voltage-dependent (NMDA) receptors, which are created with nmda = 1. It is not a distinct type.
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) # 2SNNModels.Receptors — Method
Receptors(glu::Glutamatergic, gaba::GABAergic) -> ReceptorArrayReturn [glu.AMPA, glu.NMDA, gaba.GABAa, gaba.GABAb].
SNNModels.infer_receptors — Method
infer_receptors(receptors::ReceptorArray)::NamedTupleInfer 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 hastarget == :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)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).
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.559SNNModels.norm_synapse — Method
norm_synapse(receptor::Receptor)Normalisation factor of receptor, norm_synapse(receptor.τr, receptor.τd).
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).
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.
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).
SNNModels.SomaReceptors — Constant
SomaReceptors :: ReceptorArraySomatic receptor set [AMPA, NMDA, GABAa, GABAb], the default syn of ReceptorSynapse and MultiReceptorSynapse.
| Receptor | E_rev (mV) | τr (ms) | τd (ms) | g0 (nS) | NMDA block | target |
|---|---|---|---|---|---|---|
| AMPA | 0 | 1 | 6.0 | 0.7 | no | :glu |
| NMDA | 0 | 1 | 100.0 | 0.15 | yes | :glu |
| GABAa | -70 | 0.5 | 10.0 | 2.0 | no | :gaba |
| GABAb | -90 | 30 | 400.0 | 0.006 | no | :gaba |
SNNModels.SomaSynapse — Constant
SomaSynapse :: ReceptorSynapseReceptorSynapse with syn = SomaReceptors, glu_receptors = [1, 2], gaba_receptors = [3, 4], NMDA = SomaNMDA; equal to ReceptorSynapse().
SNNModels.TripodDendSynapse — Constant
TripodDendSynapse :: ReceptorSynapseDefault dendritic synapse of Tripod and BallAndStick: a ReceptorSynapse with four receptors, glu_receptors = [1, 2], gaba_receptors = [3, 4], NMDA = EyalNMDA.
| Receptor | E_rev (mV) | τr (ms) | τd (ms) | g0 (nS) | NMDA block |
|---|---|---|---|---|---|
| AMPA | 0 | 0.26 | 2.0 | 0.73 | no |
| NMDA | 0 | 8 | 35.0 | 1.31 | yes |
| GABAa | -70 | 4.8 | 29.0 | 0.27 | no |
| GABAb | -90 | 30 | 400.0 | 0.006 | no |
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.
SNNModels.TripodSomaSynapse — Constant
TripodSomaSynapse :: ReceptorSynapseDefault somatic synapse of Tripod and BallAndStick: a ReceptorSynapse with two receptors, glu_receptors = [1], gaba_receptors = [2], NMDA = EyalNMDA.
| Receptor | E_rev (mV) | τr (ms) | τd (ms) | g0 (nS) |
|---|---|---|---|---|
AMPA (DuarteGluSoma) | 0 | 0.26 | 2.0 | 0.73 |
GABAa (MilesGabaSoma) | -70 | 0.1 | 15.0 | 0.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).
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 ofReceptor.NMDA::NMDAT = NMDAVoltageDependency(): magnesium block parameters.receptors::REC = infer_receptors(syn):NamedTuplemapping each target symbol to the indices of the receptors insyn(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)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 ofReceptor(aReceptorArray); the default is the somatic AMPA, NMDA, GABAa, GABAb setSomaReceptors.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 insyndriven by thegluinput.gaba_receptors::VIT = [3, 4]: indices insyndriven by thegabainput.
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])SNNModels.ReceptorSynapseVars — Type
ReceptorSynapseVars{MFT} <: AbstractReceptorVariableState 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 bygsyn),N x n_receptors.h::MFT = zeros(Float32, N, 4): auxiliary rise variables,N x n_receptors.
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)\]
| Field | Default | Units | Meaning |
|---|---|---|---|
τAMPA | 5ms | ms | AMPA decay time constant |
τNMDA | 100ms | ms | NMDA filter time constant |
τGABA | 10ms | ms | GABA decay time constant |
E_i | -80mV | mV | inhibitory reversal potential |
E_e | 0mV | mV | excitatory 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).
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())SNNModels.Confavreux2025SynapseVars — Type
Confavreux2025SynapseVars{VFT} <: AbstractSynapseVariableState 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).
Interface and generic functions
SNNModels.AbstractSynapseParameter — Type
AbstractSynapseParameter <: AbstractComponentSupertype 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 bysynaptic_receptors): one vector (Float32by default) of lengthNper receptor group, by default(glu = ..., gaba = ...). Connections (SpikingSynapse) add the weight of every presynaptic spike to the entry of the postsynaptic neuron inforward!.synvars::AbstractSynapseVariable(built bysynaptic_variables): the state variables (conductances, auxiliary rise variables) of the synapse model.- the current vector
syn_curr(or the columns ofisin dendritic models), written bysynaptic_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 anAbstractSynapseVariablewith state of element typeFT;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.
SNNModels.AbstractSynapseVariable — Type
AbstractSynapseVariable <: AbstractComponentSupertype of the state containers of the synapse models (one container per population or per compartment, created by synaptic_variables(synapse, N)).
Available subtypes
DeltaSynapseVars(forDeltaSynapse):ge,giCurrentSynapseVars(forCurrentSynapse):ge,giSingleExpSynapseVars(forSingleExpSynapse):ge,giDoubleExpSynapseVars(forDoubleExpSynapse):ge,gi,he,hiDoubleExpCurrentSynapseVars(forDoubleExpCurrentSynapse):ge,gi,he,hiReceptorSynapseVars(forReceptorSynapseandMultiReceptorSynapse, via the abstractAbstractReceptorVariable): matricesg,hof sizeN x n_receptorsConfavreux2025SynapseVars(forConfavreux2025Synapse):gAMPA,gNMDA,gGABA
The state variables have the precision of the population (Float32 by default, Float64 for a population built with VFT = Vector{Float64}).
SNNModels.get_synapse_symbol — Method
get_synapse_symbol(synapse::AbstractSynapseParameter, sym::Symbol) -> SymbolMap 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.
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.
SNNModels.synaptic_receptors — Method
synaptic_receptors(synapse::AbstractSynapseParameter, N::Int[, FT]) -> NamedTupleAllocate 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).
SNNModels.synaptic_variables — Method
synaptic_variables(synapse::AbstractSynapseParameter, N::Int[, FT]) -> AbstractSynapseVariableAllocate 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.
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.
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, ...):symis mapped byget_synapse_symbol(:ge,:he->:glu;:gi,:hi->:gaba; other symbols unchanged, e.g. the receptor groups of aMultiReceptorSynapse) andg = post.receptors.<sym>;targetis ignored. - Dendritic neurons (
Tripod,BallAndStick):targetis the compartment symbol (:s,:d1,:d2forTripod;:s,:dforBallAndStick),gis the bufferpost.receptors_<target>.<sym>andv_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"