norse.torch.functional.iaf module

class norse.torch.functional.iaf.IAFFeedForwardState(v: torch.Tensor)[source]

Bases: tuple

State of a feed forward IAF neuron

Parameters

v (torch.Tensor) – membrane potential

Create new instance of IAFFeedForwardState(v,)

v: torch.Tensor

Alias for field number 0

class norse.torch.functional.iaf.IAFParameters(v_th: torch.Tensor = tensor(1.), v_reset: torch.Tensor = tensor(0.), method: str = 'super', alpha: float = tensor(100.))[source]

Bases: tuple

Parametrization of a LIF neuron

Parameters
  • v_th (torch.Tensor) – threshold potential in mV

  • v_reset (torch.Tensor) – reset potential in mV

  • method (str) – method to determine the spike threshold (relevant for surrogate gradients)

  • alpha (float) – hyper parameter to use in surrogate gradient computation

Create new instance of IAFParameters(v_th, v_reset, method, alpha)

alpha: float

Alias for field number 3

method: str

Alias for field number 2

v_reset: torch.Tensor

Alias for field number 1

v_th: torch.Tensor

Alias for field number 0

class norse.torch.functional.iaf.IAFState(z: torch.Tensor, v: torch.Tensor)[source]

Bases: tuple

State of a IAF neuron

Parameters

Create new instance of IAFState(z, v)

v: torch.Tensor

Alias for field number 1

z: torch.Tensor

Alias for field number 0

norse.torch.functional.iaf.iaf_feed_forward_step(input_tensor, state, p=IAFParameters(v_th=tensor(1.), v_reset=tensor(0.), method='super', alpha=tensor(100.)), dt=0.001)[source]
Return type

Tuple[Tensor, IAFFeedForwardState]

norse.torch.functional.iaf.iaf_step(input_tensor, state, input_weights, recurrent_weights, p=IAFParameters(v_th=tensor(1.), v_reset=tensor(0.), method='super', alpha=tensor(100.)), dt=0.001)[source]
Return type

Tuple[Tensor, IAFState]