model.tools.layers.LIF

Contents

model.tools.layers.LIF#

class LIF(dt: float = 0.001, state_storage: bool = False)[source]#

Bases: LayerGen

Generator of the layer of LIF neurons

Uses norse.torch.module.lif.LIFCell module.

Parameters:
  • dt (float, optional) – Time step to use in integration. Defaults to 0.001.

  • state_storage (bool, optional) – If the truth, wraps the module into the StateStorage class, in which the intermediate states of the neuron are preserved for analysis, defaults to False

Methods

get

Initializes and returns the network layer

get(in_channels: int) Tuple[SNNCell, int][source]#

Initializes and returns the network layer

Parameters:

in_channels (int) – Number of input channels.

Returns:

The generated module and the number of channels that will be after applying this layer to a tensor with in_channels channels.

Return type:

Tuple[nn.Module, int]