sigmoid_rate_gg_1998_ipn#
- class brainpy.state.sigmoid_rate_gg_1998_ipn(in_size, tau=Quantity(10., 'ms'), lambda_=1.0, sigma=1.0, mu=0.0, g=1.0, mult_coupling=False, linear_summation=True, rectify_rate=0.0, rectify_output=False, rate_initializer=Constant(value=0.0), noise_initializer=Constant(value=0.0), name=None)#
NEST-compatible
sigmoid_rate_gg_1998_ipnnonlinear rate neuron with input noise.Description
sigmoid_rate_gg_1998_ipnimplements NEST’ssigmoid_rate_gg_1998_ipnmodel: a continuous-time rate neuron driven by stochastic input noise and shaped by the historical Gancarz-Grossberg (1998) quartic gain function. The model corresponds to NEST’srate_neuron_ipntemplate instantiated withsigmoid_rate_gg_1998nonlinearity. Multiplicative coupling factors are fixed to one for this model variant (the flag is kept for API compatibility).1. Continuous-time stochastic dynamics
The neuron rate \(X(t)\) evolves under the Itô stochastic differential equation:
\[\tau\,dX(t) = \left[-\lambda X(t) + \mu + \phi(\cdot)\right]dt + \left[\sqrt{\tau}\,\sigma\right]dW(t),\]where \(\tau > 0\) is the intrinsic time constant (ms), \(\lambda \ge 0\) is the passive decay rate, \(\mu\) is the constant mean drive, \(\sigma \ge 0\) is the input noise amplitude, and \(W(t)\) is a standard Wiener process.
2. Gancarz-Grossberg quartic gain function
The gain function \(\phi(h)\) applies a steep, saturating nonlinearity to summed synaptic input \(h\):
\[\phi(h) = \frac{(g\,h)^4}{0.1^4 + (g\,h)^4},\]where \(g > 0\) is the gain parameter controlling horizontal scaling. This form, introduced by Gancarz & Grossberg (1998) for saccade generation modeling, provides faster saturation than standard sigmoid or Hill functions and approaches a binary step near threshold. The constant denominator term \(0.1^4 = 10^{-4}\) sets the half-activation point at \(h = 0.1/g\) when \(g=1\).
Compared with the standard sigmoid \(g/(1+e^{-\beta(h-\theta)})\), the quartic gain exhibits steeper rise and faster approach to asymptotic bounds, reflecting winner-take-all dynamics in reticular formation circuits.
3. Numerical integration scheme
At each time step \(h = dt\), the model applies the stochastic exponential Euler (Euler-Maruyama) scheme:
\[X_{n+1} = P_1\,X_n + P_2\,(\mu + \mu_{ext} + \phi(\cdot)) + \sqrt{\frac{\tau\,(-0.5\,\mathrm{expm1}(-2\lambda h/\tau))}{\lambda}}\,\xi_n,\]where \(P_1 = e^{-\lambda h/\tau}\), \(P_2 = -\mathrm{expm1}(-\lambda h/\tau)/\lambda\) for \(\lambda > 0\), and \(\xi_n \sim \mathcal{N}(0, 1)\). For \(\lambda = 0\), the propagators reduce to \(P_1 = 1\), \(P_2 = h/\tau\), and the noise factor becomes \(\sqrt{h/\tau}\).
The external drive \(\mu_{ext}\) aggregates continuous current inputs and delta inputs via
sum_current_inputs()andsum_delta_inputs().4. Synaptic input routing and delayed events
When
linear_summation=True(default), the gain \(\phi\) applies to the total summed synaptic input across all sources:\[\phi(\cdot) = \phi(h_{ex,\mathrm{inst}} + h_{in,\mathrm{inst}} + h_{ex,\mathrm{del}} + h_{in,\mathrm{del}}),\]where subscripts denote instantaneous vs. delayed, excitatory vs. inhibitory branch sums. When
linear_summation=False, the gain applies to each incoming rate event before weighted summation, matching NEST’s per-event nonlinearity mode.Delayed events are stored in per-step queues (
_delayed_ex_queue,_delayed_in_queue) indexed by target step. Event polarity (excitatory or inhibitory) is determined by the sign of the weight field. Events support dict, tuple, or scalar formats:{'rate': r, 'weight': w, 'delay_steps': d, 'multiplicity': m}(r, w, d, m)or shorter tuples (defaults applied)Scalar
r(weight=1, delay_steps=0, multiplicity=1)
5. Update ordering
Per simulation step (matching NEST
rate_neuron_ipnwithsigmoid_rate_gg_1998):Store outgoing delayed value as current
rate(delayed_rate).Draw noise realization \(\xi_n\).
Propagate intrinsic dynamics \(-\lambda X\) with stochastic exponential Euler.
Read delayed and instantaneous event buffers, schedule new delayed events.
Apply gain function to branch sums (if
linear_summation=True) or per event (iflinear_summation=False).Apply rectification: if
rectify_output=True, clamprateto \(\ge\)rectify_rate.Store outgoing instantaneous value as updated
rate(instant_rate).
6. Assumptions, constraints, and failure modes
Construction-time validation ensures
tau > 0,lambda >= 0,sigma >= 0,rectify_rate >= 0.Parameters are scalar or broadcastable to
self.varshape.Delayed event
delay_stepsmust be non-negative integers; instantaneous events (instant_rate_events) must havedelay_steps=0or omit the field.Multiplicative coupling factors are identically one (
_mult_coupling_ex/inreturnones_like). Enablingmult_coupling=Truehas no effect for this model.Per-step complexity is \(O(|\mathrm{state}| \cdot K)\) for
Kevents per step.
- Parameters:
in_size (
Size) – Population shape. Supports integern(1D withnneurons), tuple(n, m)(2D grid), or higher-dimensional tuples.tau (
Quantity[ms], optional) – Intrinsic time constant \(\tau\) of rate dynamics (ms). Must be positive. Default10 ms.lambda (
floatorarray_like, optional) – Passive decay rate \(\lambda\) (dimensionless). Must be non-negative. Default1.0.sigma (
floatorarray_like, optional) – Input noise amplitude \(\sigma\) (dimensionless). Must be non-negative. Zero disables stochastic forcing. Default1.0.mu (
floatorarray_like, optional) – Constant mean drive \(\mu\) (dimensionless). Default0.0.g (
floatorarray_like, optional) – Gain parameter \(g\) of the quartic nonlinearity (dimensionless). Larger values steepen the gain curve and shift the half-activation point. Must be positive. Default1.0.mult_coupling (
bool, optional) – Multiplicative coupling flag kept for NEST compatibility. For this model variant, multiplicative factors are identically one regardless of this setting. DefaultFalse.linear_summation (
bool, optional) – IfTrue(default), apply gain \(\phi\) to total summed synaptic input. IfFalse, apply \(\phi\) to each event before weighted summation (per-event nonlinearity mode). DefaultTrue.rectify_rate (
floatorarray_like, optional) – Lower bound for rectified output whenrectify_output=True. Must be non-negative. Default0.0.rectify_output (
bool, optional) – IfTrue, clamp updatedrateto \(\ge\)rectify_rateat each step. DefaultFalse.rate_initializer (
Callable[[shape,batch_size],Array], optional) – Initializer forratestate. DefaultConstant(0.0).noise_initializer (
Callable[[shape,batch_size],Array], optional) – Initializer fornoisestate. DefaultConstant(0.0).name (
str, optional) – Module name for identification. Auto-generated if not provided.
State Variables
- rateShortTermState
Current neuron rate \(X(t)\) (dimensionless, shape
varshape + (batch_size,)).- noiseShortTermState
Last noise realization \(\sigma\,\xi_n\) (dimensionless).
- instant_rateShortTermState
Instantaneous outgoing rate (alias of
rateafter update).- delayed_rateShortTermState
Delayed outgoing rate (stored from previous step).
- _step_countShortTermState
Internal step counter (int64 scalar) for delayed event scheduling.
Parameter Mapping
brainpy.state parameter
NEST parameter
Notes
tautauTime constant (ms)
lambda_lambdaPassive decay rate
sigmasigmaInput noise amplitude
mumuConstant drive
ggGain parameter
mult_couplingmult_coupling(Always 1.0 for this model)
linear_summationlinear_summationGain application mode
rectify_raterectify_rateLower rectification bound
rectify_outputrectify_outputRectification flag
rate_initializerrate(initialization)Initial rate value
Recordables
rate: Current neuron rate (main output)noise: Last noise realization
Receptor Types
RATE: index 0 (single receptor port for all rate inputs)
Notes
Runtime event API:
instant_rate_events: Applied in the current step withdelay_steps=0. RaisesValueErrorif non-zero delay is specified.delayed_rate_events: Queued for delivery afterdelay_stepssteps (defaultdelay_steps=1if omitted).
Event format flexibility:
Dict:
{'rate': r, 'weight': w, 'delay_steps': d, 'multiplicity': m}(all fields optional exceptrate).Tuple:
(rate, weight),(rate, weight, delay_steps), or(rate, weight, delay_steps, multiplicity).Scalar: Interpreted as
ratewith weight=1, delay_steps=0, multiplicity=1.Lists of any of the above are flattened and processed sequentially.
Weight polarity: Positive weights contribute to excitatory branch, negative to inhibitory branch. Branch separation only affects
linear_summation=Falsemode withmult_coupling=True(which has no effect for this model).Examples
Create a population and drive it with noisy input:
>>> import brainpy.state as bst >>> import saiunit as u >>> import brainstate as bs >>> pop = bst.sigmoid_rate_gg_1998_ipn( ... in_size=100, tau=20*u.ms, lambda_=0.5, sigma=0.1, g=2.0 ... ) >>> pop.init_all_states() >>> with bs.environ.context(dt=0.1*u.ms): ... for _ in range(1000): ... r = pop.update(x=0.5)
Apply delayed rate events:
>>> with bs.environ.context(dt=0.1*u.ms): ... # Event at t+5 steps with weight 0.8 ... r = pop.update(delayed_rate_events=[{'rate': 1.0, 'weight': 0.8, 'delay_steps': 5}])
References
See also
sigmoid_rate_ipnStandard sigmoid gain function
lin_rate_ipnLinear rate neuron variant
tanh_rate_ipnHyperbolic tangent gain function
- init_state(**kwargs)[source]#
Initialize neuron state variables and delayed event queues.
Allocates
rate,noise,instant_rate,delayed_rate, internal step counter, and per-step delayed event dictionaries for excitatory and inhibitory branches.- Parameters:
**kwargs – Unused compatibility parameters accepted by the base-state API.
Notes
Called automatically by
init_all_states(). Initializes:rate: fromrate_initializernoise: fromnoise_initializerinstant_rate,delayed_rate: copies of initialrate_step_count: int64 scalar starting at 0_delayed_ex_queue,_delayed_in_queue: empty dicts
- property receptor_types#
Receptor port name-to-index mapping for synaptic input routing.
- Returns:
{'RATE': 0}— single receptor port accepting all rate events.- Return type:
dict[str,int]
- property recordables#
List of state variables available for recording.
- update(x=0.0, instant_rate_events=None, delayed_rate_events=None, noise=None, _precomputed_ex=None, _precomputed_in=None)[source]#
Advance rate neuron dynamics by one time step with stochastic integration.
Implements the full update cycle: drain delayed events, schedule new delayed events, aggregate instantaneous events and external inputs, propagate intrinsic dynamics with stochastic exponential Euler, apply quartic gain function, and apply optional rectification.
- Parameters:
x (
floatorarray_like, optional) – External continuous current input (dimensionless). Broadcasts tovarshape. Aggregated viasum_current_inputs(). Default0.0.instant_rate_events (
Noneorlistordictortuple, optional) – Instantaneous rate events applied in the current step. Each event must havedelay_steps=0or omit the field. Supports nested lists, dicts, tuples, or scalars. DefaultNone(no instantaneous events).delayed_rate_events (
Noneorlistordictortuple, optional) – Delayed rate events scheduled for future delivery. Each event specifiesdelay_steps >= 0(default 1 if omitted). Format matchesinstant_rate_events. DefaultNone(no delayed events).noise (
floatorarray_like, optional) – External noise realization \(\xi_n\) to override internal random draw. If provided, broadcasts tovarshape. IfNone(default), draws \(\xi_n \sim \mathcal{N}(0, 1)\) internally.
- Returns:
rate_new – Updated rate \(X_{n+1}\) (shape
varshapeorvarshape + (batch,)).- Return type:
ndarray- Raises:
ValueError – If
instant_rate_eventscontain non-zerodelay_steps.ValueError – If
delayed_rate_eventscontain negativedelay_steps.ValueError – If event tuples have unsupported length (must be 2, 3, or 4).
Notes
Computational sequence:
Convert time step to milliseconds: \(h = dt\).
Broadcast parameters (
tau,sigma,mu,g,lambda_,rectify_rate) tostate_shape.Drain delayed queues for current step index, schedule new delayed events from
delayed_rate_events.Accumulate
instant_rate_eventsand delta inputs, separating by weight polarity (excitatory/inhibitory).Aggregate external input
xviasum_current_inputs().Compute propagators \(P_1\), \(P_2\), and noise factor based on \(\lambda\).
Draw or use provided noise \(\xi_n\).
Propagate \(X_{n+1} = P_1 X_n + P_2 (\mu + \mu_{ext}) + \text{noise_factor} \cdot \sigma \xi_n\).
Apply gain \(\phi\) to synaptic inputs (mode depends on
linear_summationandmult_coupling).Add weighted synaptic contributions to \(X_{n+1}\).
Apply rectification if
rectify_output=True.Update state variables and increment step counter.
Gain application modes:
linear_summation=True,mult_coupling=False(default): \(\phi(h_{ex,\mathrm{inst}} + h_{in,\mathrm{inst}} + h_{ex,\mathrm{del}} + h_{in,\mathrm{del}})\).linear_summation=False: Gain already applied per event before summation.mult_coupling=True: Separate excitatory/inhibitory branches with multiplicative factors (always 1.0 for this model).
Delayed event scheduling: Events with
delay_steps=dare delivered at global stepcurrent_step + d. Zero-delay events indelayed_rate_eventsare applied immediately (no queueing).Random number generation: Uses NumPy’s default RNG (
np.random.normal). For reproducibility, seed the global RNG before simulation.