AdditiveCoupling#

class brainmass.AdditiveCoupling(x, conn, k=1.0, b=0.0)#

Additive (linear) coupling.

This class implements an additive coupling mechanism for neural network modules. It simulates the following model:

\[ \mathrm{current}_i = k * \sum_j g_{ij} * x_{D_{ij}} + b \]

where:
  • \(\mathrm{current}_i\): the output current for neuron \(i\)

  • \(g_{ij}\): the connection strength between neuron \(i\) and neuron \(j\)

  • \(x_{D_{ij}}\): the delayed state variable for neuron \(j\), as seen by neuron \(i\)

  • \(b\): an additive offset/bias

This is TVB’s Linear coupling; the global strength k is TVB’s G (G k).

Parameters:
  • x (PrefetchDelayAt | PrefetchDelay | Prefetch | Callable) – The delayed state variable for the source units.

  • conn (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – The connection matrix (1D or 2D array) specifying the coupling strengths between units.

  • k (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – The global coupling strength. Default is 1.0.

  • b (Callable | Array | ndarray | bool | number | bool | int | float | complex | Quantity | Param) – Additive offset/bias added after the weighted sum. Default is 0.0, which reproduces the bias-free coupling bit-for-bit. Pass a trainable Param to fit it (Param.init(0.0) yields a non-trainable Const, so the default adds no trainable state).

Return type:

Any

__init__(x, conn, k=1.0, b=0.0)[source]#
Parameters:
init_state(*args, **kwargs)[source]#

State initialization function.

update(*args, **kwargs)[source]#