ThresholdLinearStep#
- class brainmass.ThresholdLinearStep(in_size, tau_E=Quantity(0.02, 's'), tau_I=Quantity(0.01, 's'), beta_E=0.066, beta_I=0.351, init_E=ZeroInit(unit=1), init_I=ZeroInit(unit=1), noise_E=None, noise_I=None)#
Threshold-linear two-population rate model.
This model describes excitatory (E) and inhibitory (I) population rates with threshold-linear input-output functions [1]. The continuous-time dynamics are
\[\begin{split}\begin{aligned} &\tau_{E} \frac{d \nu_{E}}{d t} = -\nu_{E} + \beta_{E}\,[I_{E}]_{+}, \\ &\tau_{I} \frac{d \nu_{I}}{d t} = -\nu_{I} + \beta_{I}\,[I_{I}]_{+}, \end{aligned}\end{split}\]where \([x]_+ = \max(x, 0)\) is the rectifier. \(\nu_E\) and \(\nu_I\) denote E and I firing rates; \(\tau_E\) and \(\tau_I\) are their intrinsic time constants; \(\beta_E\) and \(\beta_I\) are gains.
- Parameters:
in_size (
int|Sequence[int] |integer|Sequence[integer]) – Spatial shape for the E and I populations. Can be anintor a tuple ofint. All parameters are broadcastable to this shape.tau_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory time constant with unit of time (e.g.,2e-2 * u.second). Default is2e-2 * u.second.tau_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory time constant with unit of time (e.g.,1e-2 * u.second). Default is1e-2 * u.second.beta_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory gain (dimensionless). Default is0.066.beta_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory gain (dimensionless). Default is0.351.init_E (
Callable) – Parameter for the excitatory rate stateE. Default isbraintools.init.ZeroInit().init_I (
Callable) – Parameter for the inhibitory rate stateI. Default isbraintools.init.ZeroInit().noise_E (
Noise) – Additive noise process for the E population. If provided, called each update and added toE_inp. Default isNone.noise_I (
Noise) – Additive noise process for the I population. If provided, called each update and added toI_inp. Default isNone.
- Return type:
Any
- E#
Excitatory rate state (dimensionless). Shape equals
(batch?,) + in_sizeafterinit_state.- Type:
brainstate.HiddenState
- I#
Inhibitory rate state (dimensionless). Shape equals
(batch?,) + in_sizeafterinit_state.- Type:
brainstate.HiddenState
Notes
Time derivatives implicitly have unit
1/timedetermined by thebrainunittime units oftau_Eandtau_I.The rectification is applied to the external drives, and the states are clipped to be non-negative after each update.
References
- init_state(batch_size=None, **kwargs)[source]#
Initialize excitatory and inhibitory states.
- Parameters:
batch_size (int or None, optional) – Optional leading batch dimension. If
None, no batch dimension is used. Default isNone.
- update(E_inp=None, I_inp=None)[source]#
Advance the system by one time step.
- Parameters:
E_inp (array-like or scalar or None, optional) – External input drive to the excitatory population. If
None, treated as zero. Ifnoise_Eis set, its output is added.I_inp (array-like or scalar or None, optional) – External input drive to the inhibitory population. If
None, treated as zero. Ifnoise_Iis set, its output is added.
- Returns:
The updated excitatory rate
Ewith the same shape as the internal state.- Return type:
array-like
Notes
Uses exponential-Euler updates via
brainstate.nn.exp_euler_stepwith rectification applied to inputs and non-negativity enforced on states.