WilsonCowanDivisiveStep#
- class brainmass.WilsonCowanDivisiveStep(in_size, tau_E=Quantity(1., 'ms'), a_E=1.2, theta_E=2.8, tau_I=Quantity(1., 'ms'), a_I=1.0, theta_I=4.0, wEE=6.0, wIE=2.0, wEI=6.5, wII=5.5, r=1.0, sigma_E=1.0, sigma_I=1.0, noise_E=None, noise_I=None, rE_init=Constant(value=0.0), rI_init=Constant(value=0.0), method='exp_euler')#
Wilson-Cowan neural mass model with divisive normalization (gain modulation).
This variant implements divisive inhibition through gain modulation, where inhibition divides the output gain rather than subtracting from the input. This form of normalization is commonly observed in visual cortex and implements contrast normalization.
- Parameters:
in_size (
int|Sequence[int] |integer|Sequence[integer]) – Spatial shape of each population (E and I). Can be an int, a tuple of ints, or any size compatible withbrainstate.tau_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory time constant with unit of time (e.g.,1. * u.ms). Broadcastable toin_size. Default is1. * u.ms.a_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory gain (dimensionless). Broadcastable toin_size. Default is1.2.theta_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory threshold (dimensionless). Broadcastable toin_size. Default is2.8.tau_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory time constant with unit of time (e.g.,1. * u.ms). Broadcastable toin_size. Default is1. * u.ms.a_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory gain (dimensionless). Broadcastable toin_size. Default is1..theta_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory threshold (dimensionless). Broadcastable toin_size. Default is4.0.wEE (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – E→E coupling strength (dimensionless). Broadcastable toin_size. Default is6.(reduced from standard model for stability).wIE (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – E→I coupling strength (dimensionless). Broadcastable toin_size. Default is2.(reduced from standard model for stability).wEI (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – I→E coupling strength (dimensionless). Broadcastable toin_size. Default is6.5(reduced from standard model for stability).wII (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – I→I coupling strength (dimensionless). Broadcastable toin_size. Default is5.5(reduced from standard model for stability).r (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Refractory parameter (dimensionless) that limits maximum activation. Broadcastable toin_size. Default is1..sigma_E (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Excitatory semisaturation constant (dimensionless) that prevents division by zero and controls the strength of divisive normalization. Broadcastable toin_size. Default is1..sigma_I (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Inhibitory semisaturation constant (dimensionless) that prevents division by zero and controls the strength of divisive normalization. Broadcastable toin_size. Default is1..noise_E (
Noise) – Additive noise process for the excitatory population. If provided, its output is added torE_inpat each update. Default isNone.noise_I (
Noise) – Additive noise process for the inhibitory population. If provided, its output is added torI_inpat each update. Default isNone.rE_init (
Callable) – Initializer for the excitatory staterE. Default isbraintools.init.Constant(0.0).rI_init (
Callable) – Initializer for the inhibitory staterI. Default isbraintools.init.Constant(0.0).method (
str) – The numerical integration method to use. One of'exp_euler','euler','rk2', or'rk4', that is implemented inbraintools.quad. Default is'exp_euler'.
- Return type:
Any
- rE#
Excitatory population activity (dimensionless). Shape equals
(batch?,) + in_sizeafterinit_state.- Type:
brainstate.HiddenState
- rI#
Inhibitory population activity (dimensionless). Shape equals
(batch?,) + in_sizeafterinit_state.- Type:
brainstate.HiddenState
Notes
The continuous-time Wilson-Cowan equations with divisive gain modulation are
\[\tau_E \frac{dr_E}{dt} = -r_E(t) + \frac{1 - r\, r_E(t)}{\sigma_E + w_{EI} r_I(t)} F_E\bigl(w_{EE} r_E(t) + I_E(t)\bigr),\]\[\tau_I \frac{dr_I}{dt} = -r_I(t) + \frac{1 - r\, r_I(t)}{\sigma_I + w_{II} r_I(t)} F_I\bigl(w_{IE} r_E(t) + I_I(t)\bigr),\]with the sigmoidal transfer function
\[F_j(x) = \frac{1}{1 + e^{-a_j (x - \theta_j)}} - \frac{1}{1 + e^{a_j \theta_j}},\quad j \in \{E, I\}.\]Divisive normalization implements gain modulation where inhibition divides the saturating term rather than subtracting from the input. This is biologically plausible and matches normalization observed in visual cortex.
References
Examples
>>> import brainmass >>> import brainunit as u >>> model = brainmass.WilsonCowanDivisiveStep( ... in_size=100, ... tau_E=1.*u.ms, ... sigma_E=1.0, ... sigma_I=1.0 ... )
- __init__(in_size, tau_E=Quantity(1., 'ms'), a_E=1.2, theta_E=2.8, tau_I=Quantity(1., 'ms'), a_I=1.0, theta_I=4.0, wEE=6.0, wIE=2.0, wEI=6.5, wII=5.5, r=1.0, sigma_E=1.0, sigma_I=1.0, noise_E=None, noise_I=None, rE_init=Constant(value=0.0), rI_init=Constant(value=0.0), method='exp_euler')[source]#
- Parameters:
tau_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
a_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
theta_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
tau_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
a_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
theta_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
wEE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
wIE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
wEI (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
wII (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
r (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
sigma_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
sigma_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param)
noise_E (Noise)
noise_I (Noise)
rE_init (Callable)
rI_init (Callable)
method (str)
- drE(rE, rI, ext)[source]#
Right-hand side for the excitatory population.
Must be implemented by subclasses.
- Parameters:
rE (array-like) – Excitatory activity (dimensionless).
rI (array-like) – Inhibitory activity (dimensionless), broadcastable to
rE.ext (array-like or scalar) – External input to E.
- Returns:
Time derivative
drE/dtwith unit of1/time.- Return type:
array-like
- drI(rI, rE, ext)[source]#
Right-hand side for the inhibitory population.
Must be implemented by subclasses.
- Parameters:
rI (array-like) – Inhibitory activity (dimensionless).
rE (array-like) – Excitatory activity (dimensionless), broadcastable to
rI.ext (array-like or scalar) – External input to I.
- Returns:
Time derivative
drI/dtwith unit of1/time.- Return type:
array-like