norse.torch.functional.lif

norse.torch.functional.lif#

A popular neuron model that combines a norse.torch.functional.leaky_integrator with spike thresholds to produce events (spikes).

The model describes the change in a neuron membrane voltage (\(v\)) and inflow current (\(i\)). See the leaky_integrator module for more information.

\[\begin{split}\begin{align*} \dot{v} &= 1/\tau_{\text{mem}} (v_{\text{leak}} - v + i) \\ \dot{i} &= 1/\tau_{\text{syn}} i \end{align*}\end{split}\]

The F in LIF stands for the thresholded “firing” events that occur if the neuron voltage increases over a certain point or threshold (\(v_{\text{th}}\)).

\[z = \Theta(v - v_{\text{th}})\]

In regular artificial neural networks, this is referred to as the activation function. The behaviour can be controlled by setting the method field in the neuron parameters, but will default to the superspike synthetic gradient approach that uses the heaviside step function:

\[\begin{split}H[n]=\begin{cases} 0, & n <= 0 \\ 1, & n \gt 0 \end{cases}\end{split}\]

More information can be found on Wikipedia or in the book *Neuron Dynamics* by W. Gerstner et al., freely available online.

Functions

lif_current_encoder(input_current, voltage, p)

Computes a single euler-integration step of a leaky integrator.

lif_feed_forward_integral(input_tensor, state, p)

Computes multiple euler-integration steps of a LIF neuron-model.

lif_feed_forward_step(input_spikes, state, p)

Computes a single euler-integration step for a lif neuron-model.

lif_feed_forward_step_sparse(input_tensor, ...)

lif_step(input_spikes, state, input_weights, ...)

Computes a single euler-integration step of a LIF neuron-model.

lif_step_integral(input_tensor, state, ...)

Computes multiple euler-integration steps of a LIF neuron-model.

lif_step_sparse(input_spikes, state, ...[, dt])

Computes a single euler-integration step of a LIF neuron-model.