spikingjelly.event_driven.examples package

Submodules

spikingjelly.event_driven.examples.tempotron_mnist module

class spikingjelly.event_driven.examples.tempotron_mnist.Net(m, T)[源代码]

基类:torch.nn.modules.module.Module

forward(x: torch.Tensor)[源代码]
training: bool
spikingjelly.event_driven.examples.tempotron_mnist.main()[源代码]
返回

None

使用高斯调谐曲线编码器编码图像为脉冲,单层Tempotron进行MNIST识别。运行示例:

>>> import spikingjelly.event_driven.examples.tempotron_mnist as tempotron_mnist
>>> tempotron_mnist.main()
输入运行的设备,例如“cpu”或“cuda:0”
 input device, e.g., "cpu" or "cuda:0": cuda:15
输入保存MNIST数据集的位置,例如“./”
 input root directory for saving MNIST dataset, e.g., "./": ./mnist
输入batch_size,例如“64”
 input batch_size, e.g., "64": 64
输入学习率,例如“1e-3”
 input learning rate, e.g., "1e-3": 1e-3
输入仿真时长,例如“100”
 input simulating steps, e.g., "100": 100
输入训练轮数,即遍历训练集的次数,例如“100”
 input training epochs, e.g., "100": 10
输入使用高斯调谐曲线编码每个像素点使用的神经元数量,例如“16”
 input neuron number for encoding a piexl in GaussianTuning encoder, e.g., "16": 16
输入保存tensorboard日志文件的位置,例如“./”
 input root directory for saving tensorboard logs, e.g., "./": ./logs_tempotron_mnist
cuda:15 ./mnist 64 0.001 100 100 16 ./logs_tempotron_mnist
train_acc 0.09375 0
cuda:15 ./mnist 64 0.001 100 100 16 ./logs_tempotron_mnist
train_acc 0.78125 512
...

Module contents