superneuromat.SNN.setup#
- SNN.setup(**kwargs)[source]#
Setup the SNN for simulation.
In
manual_setupmode, this function must be called beforesimulate().- 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
sparsefor more information.
Notes
Normally, in automatic setup (
manual_setup= False), therecommend()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_setupmode. SuperNeuroMAT can’t know which backend to use untilsimulate(time_steps= )()is called. Sincesetup()locks in the sparsity setting, and since that influences which backends can be used, the recommendation may be wrong inmanual_setupmode.We recommend you explicitly set the
backendandsparseparameters 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.
See also
simulate,backend,sparse,manual_setup,recommend_sparsity,devec