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.
- norse.torch.functional.regularization.regularize_step(z, s, accumulator=<function spike_accumulator>, state=None)¶
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.
z (torch.Tensor) – Spikes from a cell
s (Any) – Neuron state
accumulator (Accumulator) – Accumulator that decides what should be accumulated
state (Optional[Any]) – The regularization state to be aggregated. Typically some numerical value like a count. Defaults to None
- Return type
A tuple of (spikes, regularizer state)
- norse.torch.functional.regularization.spike_accumulator(z, _, state=None)¶
A spike accumulator that aggregates spikes and returns the total sum as an integer.
- norse.torch.functional.regularization.voltage_accumulator(z, s, state=None)¶
A spike accumulator that aggregates membrane potentials over time. Requires that the input state
vproperty (for voltage).