superneuromat.SNN.setup#

SNN.setup(**kwargs)[source]#

Setup the SNN for simulation.

In manual_setup mode, this function must be called before simulate().

Parameters:
  • dtype (bool | numpy.dtype, default=None) – The dtype to be used for floating-point arrays on this setup().

  • sparse (bool | str | Any, default=None) – Whether to use a sparse representation for the SNN. See sparse for more information.

Notes

Normally, in automatic setup (manual_setup = False), the recommend() function will be called to determine the best backend to use. The choice of backend determines the sparsity in this case.

However, there’s a chicken-and-egg problem for automatic backend selection in manual_setup mode. SuperNeuroMAT can’t know which backend to use until simulate(time_steps= )() is called. Since setup() locks in the sparsity setting, and since that influences which backends can be used, the recommendation may be wrong in manual_setup mode.

We recommend you explicitly set the backend and sparse parameters to avoid this problem.

Use a sparse representation when the network size is large, but there are relatively few synapses. Note that backend='cpu' is the only backend that supports sparse representations. Use the GPU backend when the network size is large and you are simulating for many consecutive time steps.

See Considerations for Speed for additional guidance on choosing a backend and sparsity setting manually.