aeif_cond_alpha_astro#
- class brainpy.state.aeif_cond_alpha_astro(in_size, V_peak=Quantity(0., "mV"), V_reset=Quantity(-60., "mV"), t_ref=Quantity(0., "ms"), g_L=Quantity(30., "nS"), C_m=Quantity(281., "pF"), E_ex=Quantity(0., "mV"), E_in=Quantity(-85., "mV"), E_L=Quantity(-70.6, "mV"), Delta_T=Quantity(2., "mV"), tau_w=Quantity(144., "ms"), a=Quantity(4., "nS"), b=Quantity(80.5, "pA"), V_th=Quantity(-50.4, "mV"), tau_syn_ex=Quantity(0.2, "ms"), tau_syn_in=Quantity(2., "ms"), I_e=Quantity(0., "pA"), gsl_error_tol=1e-06, V_initializer=Constant(value=-70.6 mV), g_ex_initializer=Constant(value=0. nS), g_in_initializer=Constant(value=0. nS), w_initializer=Constant(value=0. pA), spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='hard', ref_var=False, name=None)#
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.Store SIC ring-buffer value for next step in
I_SIC.
4. SIC event semantics
sic_eventspassed toupdate()emulate NESTSICEventhandling. For an event withweight, coefficient seriescoeffsanddelay_steps:effective ring-buffer offset is
delay_steps - 1,each coefficient is added to future SIC buffer entries as
weight * coeffs[i].
This matches NEST
handle(SICEvent&)where contributions are written tosic_currents_and become available throughI_SICwith one-step delayed application in membrane dynamics.- 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 14 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 handling is discrete-time queue based. If an SIC event
earrives at simulation step \(s_e\) with delayd_e(steps), weightw_e, and coefficients \(c_{e,i}\), this implementation enqueues:\[Q[s_e + d_e - 1 + i] \mathrel{+}= w_e c_{e,i}.\]The membrane ODE at step \(k\) uses stored \(I_{SIC}^{(k)}\) from the previous update call, so a delay of 1 step first affects dynamics on step \(s_e + 1\), matching NEST ring-buffer semantics.
Additional implementation implications:
sic_eventsaccepts dict, tuple/list, scalar, or iterable forms; tuple/list forms must have length 2 or 3.Event
coeffscan be scalar, state-shaped, or leading-time-array; each coefficient creates one future queue entry.Queue memory cost scales with active future SIC bins and state size.
As with
aeif_cond_alpha,t_ref=0can allow multiple in-loop spikes within one simulation step.
References
Examples
>>> import brainpy >>> import brainstate >>> import saiunit as u >>> neuron = brainpy.state.aeif_cond_alpha_astro(in_size=2) >>> neuron.init_state() >>> sic = {'weight': 20.0 * u.pA, 'coefficients': [1.0, 0.5], 'delay_steps': 2} >>> with brainstate.environ.context(dt=0.1 * u.ms, t=0.0 * u.ms): ... spikes = neuron.update(x=80.0 * u.pA, sic_events=[sic]) >>> 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'), sic_events=None)[source]#
Advance the neuron by one simulation step with optional SIC events.
- 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).sic_events (
object, optional) – SIC event payload consumed by_enqueue_sic_events(). Enqueued values are popped for the current queue step and stored intoI_sicfor the next update call.
- 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), if SIC tuple/list events have unsupported lengths, or if SICdelay_stepsis not positive.TypeError – If SIC event values cannot be interpreted as numeric arrays.
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
saiunit.math. SIC events are enqueued after ODE integration, then current-step SIC queue values are popped and written toI_sicfor use in the next call.