The ANN2SNN
package is intended for creating neural networks that can be converted into spiking neural networks and placed for execution on the AltAI-1 neuromorphic processor. The ANN2SNN
package is implemented in Python.
To create neural networks, it is necessary to use special ternary layers, which take into account the limitations typical of the AltAI-1 neuromorphic processor. The ternary layers used to create the neural network correspond to the layers in the Keras library, with the following main differences:
{-1,0,1}
.–32,768
to 32,767
.When training a neural network created using ternary layers, the following features should be taken into account:
Serialization and deserialization of neural networks is performed using standard methods provided by the Keras library, with the custom_objects
parameter specified in the form of a dictionary of ternary layers and the Heaviside
activation function.
During placement, the neural network is validated against the processing unit's constraints. The neural network is validated against the neuromorphic processing unit configuration settings specified in the YAML file. As a result of placement, information about the number of cores required to run a neural network on the AltAI-1 neuromorphic processor is displayed. The neural network is converted into a format supported by the processing unit, to be then executed on the hardware processor or its software emulator later. If the neural network cannot be placed on the neuromorphic processing unit because the maximum allowed number of cores is exceeded, an appropriate error is displayed.
The AltAI-1 neuromorphic processor provides the ability to scale by increasing the number of VLSI chips. For questions regarding scaling, please contact Kaspersky specialists.
You can make a rough estimate of the number of cores required to execute a neural network using the formula below, where:
Formula for estimating the number of cores
The number of cores required for placing a fully connected TernaryDense
layer depends on the number of input neurons in the layer. If the number of input neurons does not exceed 512, you can calculate the required number of cores by using the formula below, where:
Formula for estimating the number of cores for the TernaryDense layer
If the number of input neurons exceeds 512, you can calculate the required number of cores by using the formula below, where:
Formula for estimating the number of cores for the TernaryDense layer
For neural networks created on the basis of the ANN2SNN
package, the following inference options are possible: