superneuromat.SNN.simulate#

SNN.simulate(time_steps: int = 1, callback=None, use=None, sparse=None, **kwargs) None[source]#

Simulate the neuromorphic spiking neural network

See setup() and Considerations for Speed for guidance on choosing a backend and sparsity setting manually.

Parameters:
  • time_steps (int) – Number of time steps for which the neuromorphic circuit is to be simulated

  • callback (function, optional) – Function to be called after each time step, by default None

  • use (str, default=None) – Which backend to use. Can be ‘auto’, ‘cpu’, ‘jit’, or ‘gpu’. If None, SNN.backend will be used, which is ‘auto’ by default. ‘auto’ will choose a backend based on the network size and time steps.

  • sparse (bool | str | Any, default=None) – Whether to use a sparse representation for the SNN. See sparse for more information. This must be set to None if in manual_setup mode.

  • **kwargs (Any) – Additional keyword arguments to pass to the underlying setup functions.

Raises:
  • TypeError – If time_steps is not an int.

  • ValueError – If time_steps is less than or equal to zero.

Notes

The backend recommendation in manual_setup mode may be different because the backend depends on whether the SNN is sparse or not, and the sparsity setting must be set in setup() BEFORE calling simulate().