norse.torch.functional.regularization.voltage_accumulator

norse.torch.functional.regularization.voltage_accumulator#

norse.torch.functional.regularization.voltage_accumulator(z: Tensor, s: Any, state: Tensor | None = None) int[source]#

A spike accumulator that aggregates membrane potentials over time. Requires that the input state s has a v property (for voltage).

Parameters:

z (torch.Tensor): Spikes from some cell s (Any): Cell state state (Optional[torch.Tensor]): The regularization state to be aggregated to. Defaults to zeros for all entries.

Returns:

A new RegularizationState containing the aggregated data