WongWangStep#
- class brainmass.WongWangStep(in_size, tau_S=Quantity(0.1, 's'), gamma=0.641, a=Quantity(270., 'Hz / nA'), theta=Quantity(0.31, 'nA'), J_N11=Quantity(0.2609, 'nA'), J_N22=Quantity(0.2609, 'nA'), J_N12=Quantity(0.0497, 'nA'), J_N21=Quantity(0.0497, 'nA'), J_A_ext=Quantity(0.0002243, 'nC'), mu_0=Quantity(30., 'Hz'), I_0=Quantity(0.3255, 'nA'), noise_s1=None, noise_s2=None)#
Wong-Wang reduced neural-mass model for perceptual decision-making.
Implements the reduced two-variable model of Wong & Wang (2006). It describes the competitive dynamics between two neural populations (e.g. left- vs right-motion detectors) through slow NMDA-mediated recurrent excitation, capturing the temporal integration of sensory evidence during perceptual decision-making.
- Parameters:
in_size (
int|Sequence[int] |integer|Sequence[integer]) – Shape of the population (number of independent decision units).tau_S (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – NMDA receptor time constant.gamma (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Saturation factor for the synaptic gating variables.a (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Gain of the input-output (f-I) function.theta (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Firing threshold of the input-output function.J_N11 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Self-excitation strength of population 1.J_N22 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Self-excitation strength of population 2.J_N12 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Cross-inhibition strength from population 2 to population 1.J_N21 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Cross-inhibition strength from population 1 to population 2.J_A_ext (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – External input strength (AMPA).mu_0 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Baseline external input rate.I_0 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Background input current.noise_s1 (
Noise) – Noise process added to the input current of population 1.Nonedisables noise on that population.noise_s2 (
Noise) – Noise process added to the input current of population 2.Nonedisables noise on that population.
- Return type:
Any
Notes
The model evolves the synaptic gating variables \(S_1\) and \(S_2\) of the two competing populations:
\[\frac{dS_1}{dt} = -\frac{S_1}{\tau_S} + (1-S_1)\gamma r_1 , \qquad \frac{dS_2}{dt} = -\frac{S_2}{\tau_S} + (1-S_2)\gamma r_2 ,\]where the firing rates follow the threshold-linear f-I curve
\[\begin{split}r_i = \phi(I_i) = \begin{cases} a(I_i - \theta) & \text{if } I_i > \theta \\ 0 & \text{otherwise} , \end{cases}\end{split}\]and the total input currents are
\[I_1 = J_{N,11}S_1 - J_{N,12}S_2 + J_{A,ext}\mu_0(1+c) + I_0 + I_{noise,1} ,\]\[I_2 = J_{N,22}S_2 - J_{N,21}S_1 + J_{A,ext}\mu_0(1-c) + I_0 + I_{noise,2} ,\]with motion coherence \(c \in [-1, 1]\).
The network exhibits a spontaneous (symmetric) state at \(c = 0\), a decision state in which one population wins for \(|c| > 0\), bistable attractor dynamics, and slow (\(\tau_S = 100\) ms) temporal integration of evidence over hundreds of milliseconds.
References
Examples
>>> import brainmass >>> import brainstate >>> import brainunit as u >>> brainstate.environ.set(dt=0.1 * u.ms) >>> model = brainmass.WongWangStep(in_size=2) >>> _ = model.init_all_states() >>> # one decision-making step with rightward motion coherence c=0.32 >>> r1, r2 = model.update(coherence=0.32) # population firing rates (Hz) >>> r1.shape (2,) >>> # S1 and S2 synaptic gating are accessible via model.S1.value / model.S2.value
- __init__(in_size, tau_S=Quantity(0.1, 's'), gamma=0.641, a=Quantity(270., 'Hz / nA'), theta=Quantity(0.31, 'nA'), J_N11=Quantity(0.2609, 'nA'), J_N22=Quantity(0.2609, 'nA'), J_N12=Quantity(0.0497, 'nA'), J_N21=Quantity(0.0497, 'nA'), J_A_ext=Quantity(0.0002243, 'nC'), mu_0=Quantity(30., 'Hz'), I_0=Quantity(0.3255, 'nA'), noise_s1=None, noise_s2=None)[source]#
- Parameters:
tau_S (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
gamma (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
a (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
theta (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_N11 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_N22 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_N12 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_N21 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
J_A_ext (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
mu_0 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
I_0 (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
noise_s1 (Noise)
noise_s2 (Noise)
- compute_inputs(coherence=0.0, noise_1_val=Quantity(0., 'nA'), noise_2_val=Quantity(0., 'nA'))[source]#
Compute the total input currents to both populations.
- Parameters:
coherence (float, default 0.0) – Motion coherence level,
cin[-1, 1].noise_1_val (ArrayLike, default
0. * u.nA) – Noise input added to population 1.noise_2_val (ArrayLike, default
0. * u.nA) – Noise input added to population 2.
- Returns:
I1 (ArrayLike) – Total input current to population 1.
I2 (ArrayLike) – Total input current to population 2.
- get_decision(threshold=Quantity(15., 'Hz'))[source]#
Return the current decision based on a firing-rate threshold.
- Parameters:
threshold (ArrayLike, default
15. * u.Hz) – Firing-rate threshold a population must exceed to count as the winner.- Returns:
Decision code:
1if population 1 wins,-1if population 2 wins, and0if undecided.- Return type:
ArrayLike
- phi(I)[source]#
Threshold-linear input-output transfer function (f-I curve).
- Parameters:
I (ArrayLike) – Input current (in units of
nA).- Returns:
Firing rate (in units of
Hz);a * (I - theta)above threshold and0otherwise.- Return type:
ArrayLike
- update(coherence=0.0)[source]#
Advance the Wong-Wang model by one time step.
- Parameters:
coherence (float, default 0.0) – Motion coherence level,
cin[-1, 1]. Positive values favour population 1, negative values favour population 2.- Returns:
r1 (ArrayLike) – Firing rate of population 1 (in units of
Hz).r2 (ArrayLike) – Firing rate of population 2 (in units of
Hz).