WilsonCowanDelayedStep#

class brainmass.WilsonCowanDelayedStep(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=12.0, wIE=4.0, wEI=13.0, wII=11.0, r=1.0, delay_EE=Quantity(2., 'ms'), delay_IE=Quantity(2., 'ms'), delay_EI=Quantity(1.5, 'ms'), delay_II=Quantity(1.5, 'ms'), 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 connection delays.

This variant incorporates explicit time delays in the connections between populations, modeling axonal conduction delays in neural transmission. Each connection (E→E, E→I, I→E, I→I) can have its own delay time.

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 with brainstate.

  • 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 to in_size. Default is 1. * u.ms.

  • a_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory gain (dimensionless). Broadcastable to in_size. Default is 1.2.

  • theta_E (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Excitatory threshold (dimensionless). Broadcastable to in_size. Default is 2.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 to in_size. Default is 1. * u.ms.

  • a_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory gain (dimensionless). Broadcastable to in_size. Default is 1..

  • theta_I (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Inhibitory threshold (dimensionless). Broadcastable to in_size. Default is 4.0.

  • wEE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – E→E coupling strength (dimensionless). Broadcastable to in_size. Default is 12..

  • wIE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – E→I coupling strength (dimensionless). Broadcastable to in_size. Default is 4..

  • wEI (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – I→E coupling strength (dimensionless). Broadcastable to in_size. Default is 13..

  • wII (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – I→I coupling strength (dimensionless). Broadcastable to in_size. Default is 11..

  • r (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Refractory parameter (dimensionless) that limits maximum activation. Broadcastable to in_size. Default is 1..

  • delay_EE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – E→E connection delay with unit of time (e.g., 2. * u.ms). Broadcastable to in_size. Default is 2. * u.ms.

  • delay_IE (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – E→I connection delay with unit of time (e.g., 2. * u.ms). Broadcastable to in_size. Default is 2. * u.ms.

  • delay_EI (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – I→E connection delay with unit of time (e.g., 1.5 * u.ms). Broadcastable to in_size. Default is 1.5 * u.ms (faster inhibition).

  • delay_II (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – I→I connection delay with unit of time (e.g., 1.5 * u.ms). Broadcastable to in_size. Default is 1.5 * u.ms (faster inhibition).

  • noise_E (Noise) – Additive noise process for the excitatory population. If provided, its output is added to rE_inp at each update. Default is None.

  • noise_I (Noise) – Additive noise process for the inhibitory population. If provided, its output is added to rI_inp at each update. Default is None.

  • rE_init (Callable) – Initializer for the excitatory state rE. Default is braintools.init.Constant(0.0).

  • rI_init (Callable) – Initializer for the inhibitory state rI. Default is braintools.init.Constant(0.0).

  • method (str) – The numerical integration method to use. One of 'exp_euler', 'euler', 'rk2', or 'rk4', that is implemented in braintools.quad. Default is 'exp_euler'.

Return type:

Any

rE#

Excitatory population activity (dimensionless). Shape equals (batch?,) + in_size after init_state.

Type:

brainstate.HiddenState

rI#

Inhibitory population activity (dimensionless). Shape equals (batch?,) + in_size after init_state.

Type:

brainstate.HiddenState

Notes

The continuous-time Wilson-Cowan equations with delays are

\[\tau_E \frac{dr_E}{dt} = -r_E(t) + \bigl[1 - r\, r_E(t)\bigr] F_E\bigl(w_{EE} r_E(t - d_{EE}) - w_{EI} r_I(t - d_{EI}) + I_E(t)\bigr),\]
\[\tau_I \frac{dr_I}{dt} = -r_I(t) + \bigl[1 - r\, r_I(t)\bigr] F_I\bigl(w_{IE} r_E(t - d_{IE}) - w_{II} r_I(t - d_{II}) + 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\}.\]

Each connection has its own delay \(d_{XY}\) representing axonal conduction time. Delays are handled efficiently using circular buffers managed by the brainstate framework.

References

Examples

>>> import brainmass
>>> import brainunit as u
>>> model = brainmass.WilsonCowanDelayedStep(
...     in_size=100,
...     delay_EE=2.*u.ms,
...     delay_EI=1.5*u.ms
... )
__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=12.0, wIE=4.0, wEI=13.0, wII=11.0, r=1.0, delay_EE=Quantity(2., 'ms'), delay_IE=Quantity(2., 'ms'), delay_EI=Quantity(1.5, 'ms'), delay_II=Quantity(1.5, 'ms'), noise_E=None, noise_I=None, rE_init=Constant(value=0.0), rI_init=Constant(value=0.0), method='exp_euler')[source]#
Parameters:
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/dt with unit of 1/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/dt with unit of 1/time.

Return type:

array-like