WilsonCowanSymmetricStep#
- class brainmass.WilsonCowanSymmetricStep(in_size, tau=Quantity(1., 'ms'), a=1.1, theta=3.4, wEE=12.0, wIE=4.0, wEI=13.0, wII=11.0, r=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 symmetric parameters.
This variant of the Wilson-Cowan model uses symmetric parameters for the excitatory and inhibitory populations, i.e., both populations share the same time constant \(tau\), gain \(a\), and threshold \(theta\). This reduces the parameter space and can be useful for fitting or when assuming similar dynamics for both populations.
- 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 (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Shared time constant with unit of time (e.g.,1. * u.ms). Broadcastable toin_size. Default is1. * u.ms.a (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Shared gain (dimensionless). Broadcastable toin_size. Default is1.1.theta (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Shared threshold (dimensionless). Broadcastable toin_size. Default is3.4.wEE (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – E→E coupling strength (dimensionless). Broadcastable toin_size. Default is12..wIE (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – E→I coupling strength (dimensionless). Broadcastable toin_size. Default is4..wEI (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – I→E coupling strength (dimensionless). Broadcastable toin_size. Default is13..wII (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – I→I coupling strength (dimensionless). Broadcastable toin_size. Default is11..r (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|Param) – Refractory parameter (dimensionless) that limits maximum activation. 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) – Parameter for the excitatory staterE. Default isbraintools.init.Constant(0.0).rI_init (
Callable) – Parameter 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 symmetric parameters are
\[\tau \frac{dr_E}{dt} = -r_E(t) + \bigl[1 - r\, r_E(t)\bigr] F\bigl(w_{EE} r_E(t) - w_{EI} r_I(t) + I_E(t); a, \theta\bigr),\]\[\tau \frac{dr_I}{dt} = -r_I(t) + \bigl[1 - r\, r_I(t)\bigr] F\bigl(w_{IE} r_E(t) - w_{II} r_I(t) + I_I(t); a, \theta\bigr),\]with the sigmoidal transfer function
\[F(x; a, \theta) = \frac{1}{1 + e^{-a (x - \theta)}} - \frac{1}{1 + e^{a \theta}}.\]Comparison to standard Wilson-Cowan:
Unified parameters: \(\tau\) instead of \(\tau_E, \tau_I\)
Unified sigmoid: \(a\) instead of \(a_E, a_I\)
Unified threshold: \(\theta\) instead of \(\theta_E, \theta_I\)
Reduces parameter space from 11 to 6 parameters
Useful for fitting data when E/I symmetry is assumed
References
Wilson, H. R., & Cowan, J. D. (1972). Excitatory and inhibitory interactions in localized populations of model neurons. Biophysical Journal, 12, 1–24.
Examples
>>> import brainmass >>> import brainstate >>> import brainunit as u >>> brainstate.environ.set(dt=0.1 * u.ms) >>> model = brainmass.WilsonCowanSymmetricStep(1) >>> _ = model.init_all_states() >>> out = model.update(rE_inp=0.5) >>> out.shape (1,)
- __init__(in_size, tau=Quantity(1., 'ms'), a=1.1, theta=3.4, wEE=12.0, wIE=4.0, wEI=13.0, wII=11.0, r=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 (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)
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)
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