brainmass.sigmoidal_jansen_rit_coupling

brainmass.sigmoidal_jansen_rit_coupling#

brainmass.sigmoidal_jansen_rit_coupling(delayed_x, conn, k=1.0, cmin=0.0, cmax=0.005, midpoint=6.0, r=0.56)#

Sigmoidal Jansen-Rit coupling kernel (function form, pre-nonlinearity).

The TVB SigmoidalJansenRit coupling: the sigmoid is applied to each source before the network sum (a firing-rate transfer of the presynaptic potential),

\[c_i = k \sum_j w_{ij} \, \sigma_{\mathrm{JR}}(x_j), \qquad \sigma_{\mathrm{JR}}(x) = c_{\min} + \frac{c_{\max} - c_{\min}}{1 + e^{\,r\,(\mathrm{midpoint} - x)}}.\]

The source x_j is whatever the caller prefetches – e.g. the Jansen-Rit y1 - y2 pyramidal input.

Parameters:
  • delayed_x (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Zero-arg callable (e.g. a Prefetch / prefetch_delay) or array returning the presynaptic source, shaped (..., N_out, N_in) or flattened (..., N_out * N_in).

  • conn (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Connection weights, (N_out, N_in) or square-flattened (N_out * N_in,).

  • k (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Global coupling strength (TVB G; G k).

  • cmin (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Lower asymptote of the sigmoid (firing rate as x -∞).

  • cmax (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Upper asymptote of the sigmoid (firing rate as x +∞).

  • midpoint (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Half-activation potential (centre of the sigmoid).

  • r (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Steepness of the sigmoid.

Returns:

Coupling output with shape (..., N_out). σ_JR is dimensionless, so the output carries the units of k * conn.

Return type:

ArrayLike

See also

sigmoidal_coupling

post-nonlinearity (sigmoid after the sum).

brainmass.JansenRitStep

the Jansen-Rit neural mass whose output this couples.

Notes

The sigmoid argument must be dimensionless; the source is reduced to its magnitude (brainunit.get_magnitude) before the nonlinearity. At x = midpoint the transfer equals (cmin + cmax) / 2, so c_i = k * (cmin + cmax) / 2 * Σ_j w_ij; far below/above midpoint it tends to cmin / cmax respectively.

References

Examples

>>> import brainmass
>>> import jax.numpy as jnp
>>> conn = jnp.array([[0.2, 0.3], [0.5, 0.1]])
>>> x = jnp.full((2, 2), 6.0)  # at the midpoint -> sigma = (cmin + cmax) / 2
>>> out = brainmass.sigmoidal_jansen_rit_coupling(x, conn, k=1.0)
>>> [round(float(v), 6) for v in out]
[0.00125, 0.0015]