WongWangExcInhStep#

class brainmass.WongWangExcInhStep(in_size, a_e=310.0, b_e=125.0, d_e=0.16, gamma_e=0.000641, tau_e=100.0, w_p=1.4, W_e=1.0, a_i=615.0, b_i=177.0, d_i=0.087, gamma_i=0.001, tau_i=10.0, W_i=0.7, J_N=0.15, J_i=1.0, I_o=0.382, I_ext=0.0, G=2.0, lamda=0.0, init_S_e=Constant(value=0.001), init_S_i=Constant(value=0.001), noise_e=None, noise_i=None, method='exp_euler')#

Reduced Wong-Wang excitatory-inhibitory mean-field model (Deco et al., 2014).

A two-population reduction of the Wong-Wang (2006) attractor network with separate excitatory and inhibitory pools, coupled locally and (in a network) through long-range excitatory connections. It is the BOLD/FC workhorse of whole-brain modelling: the local excitation-inhibition balance set by the feedback-inhibition weight \(J_i\) shapes the resting-state dynamics [1] [2]. The model integrates the NMDA synaptic gating variables \(S_E, S_I\):

\[\begin{split}\begin{aligned} x_E &= w_p J_N S_E - J_i S_I + W_E I_o + G J_N c + I_{\mathrm{ext}}, \\ H_E &= \frac{a_E x_E - b_E}{1 - e^{-d_E (a_E x_E - b_E)}}, \qquad \dot S_E = -\frac{S_E}{\tau_E} + (1 - S_E)\,\gamma_E\,H_E, \\[4pt] x_I &= J_N S_E - S_I + W_I I_o + \lambda G J_N c, \\ H_I &= \frac{a_I x_I - b_I}{1 - e^{-d_I (a_I x_I - b_I)}}, \qquad \dot S_I = -\frac{S_I}{\tau_I} + \gamma_I\,H_I, \end{aligned}\end{split}\]

where \(c\) is the (long-range + local) coupling input, \(H_{E/I}\) are the population firing rates (the f-I transfer functions), and \(G J_N c\) is the scaled coupling current shared by both populations (the inhibitory pool receives a fraction \(\lambda\) of it).

Parameters:
  • in_size (int | Sequence[int] | integer | Sequence[integer]) – Spatial shape of the node. An int or tuple of int; all parameters broadcast to this shape.

  • a_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory f-I curve gain / shift / scaling. Defaults 310.0, 125.0, 0.160.

  • b_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory f-I curve gain / shift / scaling. Defaults 310.0, 125.0, 0.160.

  • d_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory f-I curve gain / shift / scaling. Defaults 310.0, 125.0, 0.160.

  • gamma_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory kinetic parameter. Default 0.641 / 1000.

  • tau_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory NMDA decay time constant (ms). Default 100.0.

  • w_p (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Local excitatory recurrence weight. Default 1.4.

  • W_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory external-input scaling. Default 1.0.

  • a_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory f-I curve gain / shift / scaling. Defaults 615.0, 177.0, 0.087.

  • b_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory f-I curve gain / shift / scaling. Defaults 615.0, 177.0, 0.087.

  • d_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory f-I curve gain / shift / scaling. Defaults 615.0, 177.0, 0.087.

  • gamma_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory kinetic parameter. Default 1.0 / 1000.

  • tau_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory time constant (ms). Default 10.0.

  • W_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory external-input scaling. Default 0.7.

  • J_N (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – NMDA synaptic coupling current (nA). Default 0.15.

  • J_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Local feedback-inhibition weight (the E/I-balance knob). Default 1.0.

  • I_o (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Background (overall effective external) input current. Default 0.382.

  • I_ext (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Additional external stimulation current to the excitatory pool. Default 0.0.

  • G (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Global coupling strength applied to the network input. Default 2.0.

  • lamda (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Fraction of the coupling current received by the inhibitory pool. Default 0.0.

  • init_S_e (Callable) – State initializers. Defaults braintools.init.Constant(0.001).

  • init_S_i (Callable) – State initializers. Defaults braintools.init.Constant(0.001).

  • noise_e (Noise) – Additive noise processes applied directly to the \(S_E\) / \(S_I\) derivatives. Default None.

  • noise_i (Noise) – Additive noise processes applied directly to the \(S_E\) / \(S_I\) derivatives. Default None.

  • method (str) – Integration method, 'exp_euler' (default) or any braintools.quad method (e.g. 'rk4').

Return type:

Any

S_e#

Excitatory synaptic gating (dimensionless, in [0, 1] at the fixed point). Shape (batch?,) + in_size.

Type:

brainstate.HiddenState

S_i#

Inhibitory synaptic gating.

Type:

brainstate.HiddenState

Notes

  • State variables are dimensionless; dS_e() / dS_i() carry unit 1/ms so an exponential-Euler step with dt in milliseconds is consistent (tau are in ms, gamma per-ms).

  • H_e() / H_i() return the population firing rates (the auxiliary transfer-function values) at the current state; they are recomputed each update() rather than stored.

  • The f-I transfer function has a removable singularity where its argument \(a x - b = 0\); in the physiological (low-activity) operating regime the argument stays well away from zero, so the literal TVB form is used.

References

Examples

>>> import brainmass
>>> import brainstate
>>> import brainunit as u
>>> model = brainmass.WongWangExcInhStep(in_size=1)
>>> _ = brainstate.nn.init_all_states(model)
>>> with brainstate.environ.context(dt=0.1 * u.ms):
...     S_e = model.update()
>>> S_e.shape
(1,)
H_e(coupling=0.0)[source]#

Excitatory population firing rate H_E at the current state.

H_i(coupling=0.0)[source]#

Inhibitory population firing rate H_I at the current state.

__init__(in_size, a_e=310.0, b_e=125.0, d_e=0.16, gamma_e=0.000641, tau_e=100.0, w_p=1.4, W_e=1.0, a_i=615.0, b_i=177.0, d_i=0.087, gamma_i=0.001, tau_i=10.0, W_i=0.7, J_N=0.15, J_i=1.0, I_o=0.382, I_ext=0.0, G=2.0, lamda=0.0, init_S_e=Constant(value=0.001), init_S_i=Constant(value=0.001), noise_e=None, noise_i=None, method='exp_euler')[source]#
Parameters:
dS_e(S_e, S_i, coupling, add=0.0)[source]#

Right-hand side for the excitatory gating S_e (unit 1/ms).

dS_i(S_i, S_e, coupling, add=0.0)[source]#

Right-hand side for the inhibitory gating S_i (unit 1/ms).

derivative(state, t, coupling, add_e=0.0, add_i=0.0)[source]#
init_state(batch_size=None, **kwargs)[source]#

Allocate the excitatory (S_e) and inhibitory (S_i) gating states.

Parameters:

batch_size (int or None, optional) – Optional leading batch dimension. If None, no batch dimension is used. Default is None.

update(coupling=None)[source]#

Advance the excitatory/inhibitory gating by one time step.

Parameters:

coupling (array-like or scalar or None, optional) – Network coupling input (scaled internally by G * J_N). If None, treated as zero. Default is None.

Returns:

The updated excitatory gating S_e (the coupling observable), same shape as the internal state.

Return type:

array-like