norse.torch.functional.leaky_integrator module

Leaky integrators describe a leaky neuron membrane that integrates incoming currents over time, but never spikes. In other words, the neuron adds up incoming input current, while leaking out some of it in every timestep.

\[\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 first equation describes how the membrane voltage (\(v\), across the membrane) changes over time. A constant amount of current is leaked out every timestep (\(v_{\text{leak}}\)), while the current (\(i\)) is added.

The second equation describes how the current flowing into the neuron changes in every timestep.

Notice that both equations are parameterized by the time constant \(\tau\). This constant controls how fast the changes in voltage and current occurs. A large time constant means a small change. In Norse, we call this parameter the inverse to avoid having to recalculate the inverse (\(\tau_{\text{mem_inv}}\) and \(\tau_{\text{syn_inv}}\) respectively). So, for Norse a large inverse time constant means rapid changes while a small inverse time constant means slow changes.

Recall that voltage is the difference in charge between two points (in this case the neuron membrane) and current is the rate of change or the amount of current being added/subtracted at each timestep.

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

class norse.torch.functional.leaky_integrator.LIParameters(tau_syn_inv: torch.Tensor = tensor(200.), tau_mem_inv: torch.Tensor = tensor(100.), v_leak: torch.Tensor = tensor(0.))[source]

Bases: tuple

Parameters of a leaky integrator

Parameters

Create new instance of LIParameters(tau_syn_inv, tau_mem_inv, v_leak)

tau_mem_inv: torch.Tensor

Alias for field number 1

tau_syn_inv: torch.Tensor

Alias for field number 0

v_leak: torch.Tensor

Alias for field number 2

class norse.torch.functional.leaky_integrator.LIState(v: torch.Tensor, i: torch.Tensor)[source]

Bases: tuple

State of a leaky-integrator

Parameters

Create new instance of LIState(v, i)

i: torch.Tensor

Alias for field number 1

v: torch.Tensor

Alias for field number 0

norse.torch.functional.leaky_integrator.li_feed_forward_step(input_tensor, state, p=LIParameters(tau_syn_inv=tensor(200.), tau_mem_inv=tensor(100.), v_leak=tensor(0.)), dt=0.001)[source]
Return type

Tuple[Tensor, LIState]

norse.torch.functional.leaky_integrator.li_step(input_tensor, state, input_weights, p=LIParameters(tau_syn_inv=tensor(200.), tau_mem_inv=tensor(100.), v_leak=tensor(0.)), dt=0.001)[source]

Single euler integration step of a leaky-integrator. More specifically it implements a discretized version of the ODE

\[\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}\]

and transition equations

\[i = i + w i_{\text{in}}\]
Parameters
Return type

Tuple[Tensor, LIState]