norse.task.mnist module

In this task, we train a spiking convolutional network to learn the MNIST digit recognition task.

class norse.task.mnist.LIFConvNet(input_features, seq_length, input_scale, model='super', only_first_spike=False)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
norse.task.mnist.load(path, model, optimizer)[source]
norse.task.mnist.main(args)[source]
norse.task.mnist.save(path, epoch, model, optimizer, is_best=False)[source]
norse.task.mnist.test(model, device, test_loader, epoch, method, writer)[source]
norse.task.mnist.train(model, device, train_loader, optimizer, epoch, clip_grad, grad_clip_value, epochs, log_interval, do_plot, plot_interval, seq_length, writer)[source]