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. Anintor tuple ofint; 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. Defaults310.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. Defaults310.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. Defaults310.0,125.0,0.160.gamma_e (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory kinetic parameter. Default0.641 / 1000.tau_e (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory NMDA decay time constant (ms). Default100.0.w_p (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Local excitatory recurrence weight. Default1.4.W_e (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory external-input scaling. Default1.0.a_i (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory f-I curve gain / shift / scaling. Defaults615.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. Defaults615.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. Defaults615.0,177.0,0.087.gamma_i (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory kinetic parameter. Default1.0 / 1000.tau_i (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory time constant (ms). Default10.0.W_i (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory external-input scaling. Default0.7.J_N (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – NMDA synaptic coupling current (nA). Default0.15.J_i (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Local feedback-inhibition weight (the E/I-balance knob). Default1.0.I_o (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Background (overall effective external) input current. Default0.382.I_ext (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Additional external stimulation current to the excitatory pool. Default0.0.G (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Global coupling strength applied to the network input. Default2.0.lamda (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Fraction of the coupling current received by the inhibitory pool. Default0.0.init_S_e (
Callable) – State initializers. Defaultsbraintools.init.Constant(0.001).init_S_i (
Callable) – State initializers. Defaultsbraintools.init.Constant(0.001).noise_e (
Noise) – Additive noise processes applied directly to the \(S_E\) / \(S_I\) derivatives. DefaultNone.noise_i (
Noise) – Additive noise processes applied directly to the \(S_E\) / \(S_I\) derivatives. DefaultNone.method (
str) – Integration method,'exp_euler'(default) or anybraintools.quadmethod (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 unit1/msso an exponential-Euler step withdtin milliseconds is consistent (tauare in ms,gammaper-ms).H_e()/H_i()return the population firing rates (the auxiliary transfer-function values) at the current state; they are recomputed eachupdate()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,)
- __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:
a_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
b_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
d_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
gamma_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
tau_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
w_p (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
W_e (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
a_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
b_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
d_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
gamma_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
tau_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
W_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_N (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_i (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
I_o (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
I_ext (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
G (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
lamda (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
init_S_e (Callable)
init_S_i (Callable)
noise_e (Noise)
noise_i (Noise)
method (str)
- dS_e(S_e, S_i, coupling, add=0.0)[source]#
Right-hand side for the excitatory gating
S_e(unit1/ms).
- dS_i(S_i, S_e, coupling, add=0.0)[source]#
Right-hand side for the inhibitory gating
S_i(unit1/ms).
- 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 isNone.
- 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). IfNone, treated as zero. Default isNone.- Returns:
The updated excitatory gating
S_e(the coupling observable), same shape as the internal state.- Return type:
array-like