aeif_cond_alpha_astro#
- class brainpy.state.aeif_cond_alpha_astro(*args, **kwargs)#
NEST-compatible
aeif_cond_alpha_astroneuron model.Short description
Conductance-based adaptive exponential integrate-and-fire neuron with alpha-shaped synapses and support for astrocyte slow inward current (SIC).
Description
This model follows NEST
models/aeif_cond_alpha_astro.{h,cpp}and is a direct extension ofaeif_cond_alphawith an additional SIC current term in the membrane equation.1. Continuous dynamics
Let \(V\) be membrane voltage and \(w\) adaptation current.
\[C_m \frac{dV}{dt} = -g_L (V - E_L) + g_L \Delta_T \exp\!\left(\frac{V - V_{th}}{\Delta_T}\right) - g_{ex}(V - E_{ex}) - g_{in}(V - E_{in}) - w + I_e + I_{stim} + I_{SIC}.\]Adaptation dynamics:
\[\tau_w \frac{dw}{dt} = a (V - E_L) - w.\]Alpha conductance states (two states per channel):
\[\frac{d\,dg_{ex}}{dt} = -\frac{dg_{ex}}{\tau_{syn,ex}}, \qquad \frac{d g_{ex}}{dt} = dg_{ex} - \frac{g_{ex}}{\tau_{syn,ex}},\]\[\frac{d\,dg_{in}}{dt} = -\frac{dg_{in}}{\tau_{syn,in}}, \qquad \frac{d g_{in}}{dt} = dg_{in} - \frac{g_{in}}{\tau_{syn,in}}.\]Incoming spike weights are interpreted in nS and split by sign:
\[dg_{ex} \leftarrow dg_{ex} + \frac{e}{\tau_{syn,ex}} w_+, \qquad dg_{in} \leftarrow dg_{in} + \frac{e}{\tau_{syn,in}} |w_-|.\]2. Refractory and spike handling
During refractory integration, effective voltage is clamped to
V_resetand \(dV/dt = 0\). Otherwise the RHS uses \(\min(V, V_{peak})\) as in NEST.Threshold detection uses:
V_peakifDelta_T > 0V_thifDelta_T == 0
On a detected spike (inside RKF45 substeps):
V <- V_resetw <- w + brefractory counter
r <- refractory_counts + 1ift_ref > 0
3. Update order per simulation step (NEST semantics)
Integrate ODEs on \((t, t+dt]\) with adaptive RKF45.
Inside integration loop: refractory clamp and spike/reset/adaptation.
Decrement refractory counter once.
Apply arriving spike weights to
dg_ex/dg_in.Store new external current into one-step delayed
I_stim.Read the labelled
'I_SIC'current channel and store it into the one-step delayedI_SICstate.
4. SIC delivery semantics
The astrocyte slow-inward current (SIC) is delivered on the JAX substrate by a
EventProjection— thesic_connection— that depositsweight·SICinto this neuron’s labelled'I_SIC'current channel each step (add_current_input). Eachupdate()reads (and pops) that channel before the unlabelledI_stimread, so the device current and the SIC current land in their own terms with no collision, and stores it intoI_sic(pA) for the next step.This matches NEST
handle(SICEvent&)where contributions are written tosic_currents_and become available throughI_SICwith one-step delayed application in membrane dynamics. The host-side event queue used by earlier revisions is removed: the SIC current is a State-backed channel, so the whole simulation lowers into one compiledfor_loop.- Parameters:
in_size (
Size) – Population shape. States are broadcast/initialized overself.varshapederived fromin_size.V_peak (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.V_reset (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.V_th (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.E_ex (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.E_in (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.E_L (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.Delta_T (
ArrayLike) – Voltage-like parameters in mV, each broadcastable toself.varshape.t_ref (
ArrayLike) – Time constants in ms, broadcastable toself.varshape.tau_w (
ArrayLike) – Time constants in ms, broadcastable toself.varshape.tau_syn_ex (
ArrayLike) – Time constants in ms, broadcastable toself.varshape.tau_syn_in (
ArrayLike) – Time constants in ms, broadcastable toself.varshape.g_L (
ArrayLike) – Conductances in nS, broadcastable toself.varshape.a (
ArrayLike) – Conductances in nS, broadcastable toself.varshape.C_m (
ArrayLike) – Membrane capacitance in pF, broadcastable toself.varshape.b (
ArrayLike) – Currents in pA, broadcastable toself.varshape.I_e (
ArrayLike) – Currents in pA, broadcastable toself.varshape.gsl_error_tol (
ArrayLike) – Unitless local RKF45 error tolerance, broadcastable and strictly positive.V_initializer (
Callable) – Initializer callables used byinit_state()andreset_state().g_ex_initializer (
Callable) – Initializer callables used byinit_state()andreset_state().g_in_initializer (
Callable) – Initializer callables used byinit_state()andreset_state().w_initializer (
Callable) – Initializer callables used byinit_state()andreset_state().spk_fun (
Callable) – Surrogate spike function used byget_spike().spk_reset (
str) – Reset mode inherited fromNeuron.ref_var (
bool) – IfTrue, allocate and exposeself.refractorystate.name (
str | None) – Optional node name.
Parameter Mapping
Table 16 Parameter mapping to model symbols# Parameter
Type / shape / unit
Default
Math symbol
Semantics
in_sizeSize; scalar or tuplerequired
–
Population shape defining
self.varshape.V_peakArrayLike, broadcastable to
self.varshape(mV)0.0 * u.mV\(V_\mathrm{peak}\)
Spike detection threshold when
Delta_T > 0and RHS clamp limit via \(\min(V, V_{peak})\).V_resetArrayLike, broadcastable (mV)
-60.0 * u.mV\(V_\mathrm{reset}\)
Membrane reset value and refractory clamp voltage.
t_refArrayLike, broadcastable (ms)
0.0 * u.ms\(t_\mathrm{ref}\)
Absolute refractory duration converted to integer step counts using
ceil(t_ref / dt).g_L,C_mArrayLike, broadcastable (nS, pF)
30.0 * u.nS,281.0 * u.pF\(g_L\), \(C_m\)
Leak conductance and membrane capacitance in the AdEx membrane ODE.
E_ex,E_in,E_LArrayLike, broadcastable (mV)
0.0 * u.mV,-85.0 * u.mV,-70.6 * u.mV\(E_\mathrm{ex}\), \(E_\mathrm{in}\), \(E_L\)
Excitatory, inhibitory, and leak reversal potentials.
Delta_T,V_thArrayLike, broadcastable (mV)
2.0 * u.mV,-50.4 * u.mV\(\Delta_T\), \(V_\mathrm{th}\)
Exponential spike-initiation slope and soft-threshold location.
tau_w,a,bArrayLike, broadcastable (ms, nS, pA)
144.0 * u.ms,4.0 * u.nS,80.5 * u.pA\(\tau_w\), \(a\), \(b\)
Adaptation time constant, subthreshold coupling, and spike-triggered jump amplitude.
tau_syn_ex,tau_syn_inArrayLike, broadcastable (ms)
0.2 * u.ms,2.0 * u.ms\(\tau_{\mathrm{syn,ex}}\), \(\tau_{\mathrm{syn,in}}\)
Alpha conductance time constants for excitatory/inhibitory channels.
I_eArrayLike, broadcastable (pA)
0.0 * u.pA\(I_e\)
Constant injected current added every RKF45-accepted substep.
gsl_error_tolArrayLike, broadcastable, unitless,
> 01e-6–
Local absolute tolerance for the embedded RKF45 error estimate.
V_initializerCallable
Constant(-70.6 * u.mV)–
Initializer for membrane state
V.g_ex_initializer,g_in_initializerCallable
Constant(0.0 * u.nS)–
Initializers for
g_exandg_in;dg_exanddg_inare always reset to zero.w_initializerCallable
Constant(0.0 * u.pA)–
Initializer for adaptation current
w.spk_funCallable
ReluGrad()–
Surrogate spike nonlinearity used by
get_spike().spk_resetstr
'hard'–
Reset policy inherited from
Neuron; hard reset matches NEST behavior.ref_varbool
False–
If
True, expose boolean stateself.refractory.namestr | None
None–
Optional node name.
- Raises:
ValueError – If parameters violate NEST-compatible constraints:
V_reset < V_peak,V_peak >= V_th,Delta_T >= 0,C_m > 0,t_ref >= 0, all time constants strictly positive, andgsl_error_tol > 0. Also raised when the exponential threshold expression can overflow at spike time, for invalid SIC event tuples or non-positive SIC delays, and for runtime instability guards inupdate().TypeError – If incompatible unitful/unitless values are passed and arithmetic fails during parameter broadcasting, SIC event coercion, or updates.
- V#
Membrane potential \(V_m\) (mV).
- Type:
HiddenState
- dg_ex, dg_in
Alpha auxiliary states stored as numeric values representing \(\mathrm{nS}/\mathrm{ms}\).
- Type:
ShortTermState
- g_ex, g_in
Excitatory and inhibitory conductances (nS).
- Type:
HiddenState
- w#
Adaptation current (pA).
- Type:
HiddenState
- I_stim#
One-step delayed injected current buffer (pA).
- Type:
ShortTermState
- I_sic#
One-step delayed SIC current (pA) loaded from the SIC queue.
- Type:
ShortTermState
- refractory_step_count#
Remaining refractory grid steps (
int32).- Type:
ShortTermState
- integration_step#
Persistent RKF45 substep size estimate (ms).
- Type:
ShortTermState
- last_spike_time#
Last emitted spike time (ms); written as
t + dton spike.- Type:
ShortTermState
- refractory#
Optional boolean refractory indicator, available only when
ref_var=True.- Type:
ShortTermState
Recordables
Dynamic recordables follow NEST naming:
V_mg_exg_inwI_SIC
See also
aeif_cond_alphaAdEx alpha-conductance model without SIC support.
aeif_cond_alpha_multisynapseAdEx alpha-conductance model with multiple receptor ports.
sic_connectionNEST-style SIC connection model for astrocyte-mediated currents.
Notes
The alpha-synapse subsystem is identical to
aeif_cond_alpha; for an event of effective conductance weight \(w\) injected viadg += e w / \tau, the resulting conductance kernel is:\[g(t) = w \cdot \frac{t}{\tau} \exp\!\left(1-\frac{t}{\tau}\right),\quad t \ge 0.\]SIC is delivered as a State-backed current channel. The membrane ODE at step \(k\) uses the stored \(I_{SIC}^{(k)}\) from the previous update call, so a SIC current deposited at step \(s\) first affects dynamics on step \(s + 1\), matching NEST’s one-step ring-buffer semantics at the minimum delay.
Additional implementation implications:
SIC arrives via
add_current_input(key, weight·SIC, label='I_SIC')and is read withsum_current_inputs(label='I_SIC')— no host-side event queue.The labelled
'I_SIC'read happens before the unlabelledI_stimread, so device currents and the SIC current never collide.As with
aeif_cond_alpha,t_ref=0can allow multiple in-loop spikes within one simulation step.
References
Examples
>>> import brainpy >>> import brainstate >>> import brainunit as u >>> neuron = brainpy.state.aeif_cond_alpha_astro(in_size=2) >>> neuron.init_state() >>> # A slow-inward current is deposited on the labelled 'I_SIC' channel >>> # (as the sic_connection projection does inside a Simulator). >>> with brainstate.environ.context(dt=0.1 * u.ms, t=0.0 * u.ms): ... neuron.add_current_input('sic', 20.0, label='I_SIC') ... spikes = neuron.update(x=80.0 * u.pA) >>> spikes.shape (2,)
- get_spike(V=None)[source]#
Evaluate surrogate spike output from membrane voltage.
- Parameters:
V (
ArrayLike, optional) – Voltage values with shape broadcastable toself.varshapeand units compatible with mV. IfNone, uses current stateself.V.value.- Returns:
Surrogate spike activation produced by
spk_fun((V - V_th) / (V_th - V_reset)).- Return type:
ArrayLike
- init_state(**kwargs)[source]#
Initialize persistent and short-term state variables.
- Parameters:
**kwargs – Unused compatibility parameters accepted by the base-state API.
- Raises:
ValueError – If an initializer cannot be broadcast to requested shape.
TypeError – If initializer outputs have incompatible units/dtypes for the corresponding state variables.
- update(x=Quantity(0., 'pA'), w_by_rec=None)[source]#
Advance the neuron by one simulation step.
The astrocyte slow-inward current (SIC) is delivered by a
EventProjection(thesic_connection) that depositsweight·SICinto this neuron’s labelled'I_SIC'current channel each step.updatereads (and pops) that channel, stores it intoI_sic(pA) for the next step — a one-step delay, exactly likeI_stim— and the membrane ODE adds thei_sicterm.- Parameters:
x (
ArrayLike, optional) – Continuous external current input in pA, broadcastable toself.varshape. This value is stored intoI_stimand applied at the next simulation step (one-step delay).w_by_rec (
ArrayLikeorNone, optional) – Per-receptor synaptic conductance jumps supplied by the Simulator’s multi-receptor bridge, shape(*varshape, n_receptors)as a dimensionlessnSmantissa. Column 0 (receptor_type=1) is added to the excitatory conductance and column 1 (receptor_type=2) to the inhibitory conductance. WhenNone(the legacy path), the jumps are self-pulled from thelabel='w_ex'/'w_in'delta inputs instead.
- Returns:
Binary spike tensor with dtype
jnp.float64and shapeself.V.value.shape. A value of1.0indicates at least one internal spike event occurred during the integrated interval \((t, t+dt]\).- Return type:
jax.Array- Raises:
ValueError – If RKF45 integration enters a guarded unstable regime (
V < -1e3 mVor|w| > 1e6 pA).
Notes
Integration is performed with an adaptive vectorized RKF45 loop, including in-loop spike/reset/adaptation events and optional multiple spikes per step. All arithmetic is unit-aware via
brainunit.math. The labelled'I_SIC'current channel is read before the unlabelledI_stimread so the device current and the SIC current land in their own terms (no channel collision).