brainmass.sigmoidal_coupling

brainmass.sigmoidal_coupling#

brainmass.sigmoidal_coupling(delayed_x, conn, k=1.0, a=1.0, b=0.0, slope=1.0, midpoint=0.0)#

Sigmoidal coupling kernel (function form, post-nonlinearity).

The TVB Sigmoidal coupling: a logistic nonlinearity is applied after the network sum, so each target’s coupled input saturates smoothly,

\[c_i = k \, \sigma\!\left(\mathrm{slope} \cdot \left(a \sum_j w_{ij} x_j + b - \mathrm{midpoint}\right)\right), \qquad \sigma(z) = \frac{1}{1 + e^{-z}}.\]
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 source signal, 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). Scales the saturated output.

  • a (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Linear scaling of the network sum before the sigmoid.

  • b (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Linear offset added to the network sum before the sigmoid.

  • slope (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Steepness of the logistic nonlinearity.

  • midpoint (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Centre of the logistic nonlinearity.

Returns:

Coupling output with shape (..., N_out). The logistic is dimensionless, so the output carries the units of k.

Return type:

ArrayLike

See also

hyperbolic_tangent_coupling

symmetric (tanh) post-nonlinearity.

sigmoidal_jansen_rit_coupling

pre-nonlinearity Jansen-Rit sigmoid.

additive_coupling

the underlying linear (k * sum + b) coupling.

Notes

The argument of the logistic must be dimensionless; the network sum is reduced to its magnitude (brainunit.get_magnitude) before the nonlinearity, mirroring the Jansen-Rit house style. At zero net input the output is k * sigma(slope * (b - midpoint)) (= k * sigma(-slope * midpoint) for the default a = 1, b = 0).

References

Examples

>>> import brainmass
>>> import jax.numpy as jnp
>>> conn = jnp.ones((2, 2))
>>> x = jnp.zeros((2, 2))  # zero net input
>>> out = brainmass.sigmoidal_coupling(x, conn, k=1.0, slope=1.0, midpoint=0.0)
>>> [round(float(v), 3) for v in out]
[0.5, 0.5]