pyeeg.simulate.NeuralMassNetwork
- class pyeeg.simulate.NeuralMassNetwork(N, W, delay=0, node_dynamics=None, dt=0.001, seed=42, node_kwargs=None, coupling='linear')
Abstract base class for a network of coupled neural-mass nodes.
A network is made of
Nnodes, each instantiated from a node-dynamics class (e.g.Phasor,HopfOscillator,WilsonCowan), coupled through a connectivity matrixWand a coupling function. Each step, the scalar readout of every node is combined through the coupling function into an input that is fed back to the nodes.- Parameters:
N (int) – The number of nodes in the network.
W (array_like) – The connectivity matrix. Shape (N, N). Entry
W[i, j]is the coupling strength from node j to node i.delay (float) – The delay between nodes in seconds. Stored for compatibility; not used by the default coupling scheme.
node_dynamics (class, optional) – The class of the node dynamics used to instantiate the
Nnodes. Must acceptdtandseedkeyword arguments. IfNone, no nodes are instantiated andstep()will raise a RuntimeError.dt (float) – The integration time step in seconds.
seed (int) – The random seed used to initialise the network’s random number generator and the per-node seeds.
node_kwargs (dict, optional) – Extra keyword arguments passed to the
node_dynamicsconstructor. Cannot overridedtorseed.coupling (str or callable) – Either a supported coupling name (
"linear","diffusive","kuramoto") or a callable with signaturef(readouts, connectivity, phases=None)returning the coupling input to each node. Default is"linear".
- Raises:
ValueError – If
Wdoes not have shape (N, N), or ifnode_kwargsattempts to overridedtorseed.
Methods
Reset the network to its initial state.
Simulate the network and return its outputs.
Advance the network by one integration step.