brainmass.hyperbolic_tangent_coupling#
- brainmass.hyperbolic_tangent_coupling(delayed_x, conn, k=0.5, scale=2.0)#
Hyperbolic-tangent coupling kernel (function form, post-nonlinearity).
The TVB
HyperbolicTangentcoupling: a symmetric saturating nonlinearity is applied after the network sum,\[c_i = k \, \tanh\!\left(\mathrm{scale} \sum_j w_{ij} x_j\right).\]- Parameters:
delayed_x (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Zero-arg callable (e.g. aPrefetch/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 (TVBG;G ≡ k). The output saturates to±k.scale (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Scaling of the network sum before thetanh.
- Returns:
Coupling output with shape
(..., N_out).tanhis dimensionless, so the output carries the units ofk.- Return type:
ArrayLike
See also
sigmoidal_couplingasymmetric (logistic) post-nonlinearity.
additive_couplingthe underlying linear coupling.
Notes
The argument of
tanhmust be dimensionless; the network sum is reduced to its magnitude (brainunit.get_magnitude) before the nonlinearity. As|sum| → ∞the output saturates to±k.References
Examples
>>> import brainmass >>> import jax.numpy as jnp >>> conn = jnp.ones((2, 2)) >>> x = jnp.full((2, 2), 1e3) # large positive net input saturates to +k >>> out = brainmass.hyperbolic_tangent_coupling(x, conn, k=0.5, scale=2.0) >>> [round(float(v), 3) for v in out] [0.5, 0.5]