qualia_plugin_snn.learningframework.SpikingJelly module
Provide the SpikingJelly single-step learningframework module.
- class qualia_plugin_snn.learningframework.SpikingJelly.SpikingJelly[source]
Bases:
PyTorch
SpikingJelly single-step LearningFramework implementation extending PyTorch.
qualia_core.learningframework.PyTorch.PyTorch.learningmodels
are replaced by the Spiking Neural Networks fromqualia_plugin_snn.learningmodel.pytorch
- learningmodels: ModuleType
qualia_plugin_snn.learningmodel.pytorch
additional learningmodels for Spiking Neural Networks.
- class TrainerModule[source]
Bases:
TrainerModule
SpikingJelly single-step TrainerModule implementation extending PyTorch TrainerModule.
- forward(x: Tensor) Tensor [source]
Forward pass for a Spiking Neural Network model with duplicated timesteps.
First calls SpikingJelly’s reset on the model to reset neurons potentials. Then duplicate the input to generate the number of timesteps given by
qualia_plugin_snn.learningmodel.pytorch.SNN.SNN.timesteps
Callqualia_plugin_snn.learningmodel.pytorch.SNN.SNN.forward()
for each timestep. Finally, average the output of the model over the timesteps.