Legacy models and snn Migration#
The original mnn.models and mnn.snn classes remain importable for compatibility, but they are legacy APIs. New code should use the Torch-first APIs added alongside them.
The new APIs use the Pythonic mnn.mnn_core.nn Torch modules and avoid the old NumPy/SciPy activation and moment-helper path. Legacy Loihi/NxSDK deployment code in mnn.snn.snn2loihi is a hardware boundary and is not part of the Torch-first refactor.
Use these modules for new code:
mnn.models.mlp_torchmnn.models.cnn_torchmnn.snn.base.*_torchmnn.snn.mnn_to_snn_torchmnn.snn.functional_torch
Models#
Legacy API |
Torch-first API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
SNN#
Legacy API |
Torch-first API |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SNN Validation Helpers#
Legacy API |
Torch-first API |
|---|---|
|
|
|
|
|
|
|
|
|
|
Notes#
New model APIs use clearer names such as
num_classes,use_covariance,linear_bias, andnorm_bias_variance.New SNN current sources sample correlated Gaussian currents with Torch tensors on the input device.
Probe and save/export helpers may explicitly move data to CPU because they are collection boundaries, not core computation paths.
mnn.snn.functional_torchprovides the Torch-first validation workflow and should be preferred overmnn.snn.functionalfor new simulation scripts.mnn.snn.snn2loihiremains legacy because NxSDK, HDF5 export, and plotting workflows require NumPy-facing interfaces.