Network

Network#

class brainpy.state.network.Network(*args, **kwargs)#

brainpy.state network base class.

Subclass and define populations, projections, and devices as attributes. update() walks the immediate module-tree children in projection-first then dynamics order.

simulate(duration, *, dt=None, monitor=None)[source]#

Run the network for duration.

Wraps brainstate.transform.for_loop over self.update.

Parameters:
  • duration (brainunit.Quantity) – Wall-clock time to simulate.

  • dt (brainunit.Quantity, optional) – Timestep override. Defaults to brainstate.environ.get('dt').

  • monitor (list[str] | dict[str, Callable] | None) –

    Per-step recording specification:

    • None (default) — no monitoring; the function returns {}.

    • list of dotted attribute paths (e.g. ['exc.spike']) — stacked across time and returned under that key.

    • dict of name -> callable(net): callable evaluated each step, result stacked under name.