norse.torch.functional.regularization

norse.torch.functional.regularization#

This module contains functional components for regularization operations on spiking layers, where it can be desirable to regularize spikes, membrane parameters, or other properties over time.

In this functional module, the aim is to collect some state s for each forward step. The collection depends on the output of the layer which, by default, simply just counts spikes. It is the job of the user to include the regularization in an error term later.

Read more on Wikipedia.

Functions

regularize_step(z, s[, accumulator, state])

Takes one step for a regularizer that aggregates some information (based on the spike_accumulator function), which is pushed forward and returned for future inclusion in an error term.

spike_accumulator(z, _[, state])

A spike accumulator that aggregates spikes and returns the total sum as an integer.

voltage_accumulator(z, s[, state])

A spike accumulator that aggregates membrane potentials over time.