PySNN Documentation

pysnn.encoding

pysnn.encoding

pysnn.encoding.poisson_encoding(intensities, duration, dt)

Encode a set of spiking intensities to spike trains using a Poisson distribution.

Adapted from:

https://github.com/Hananel-Hazan/bindsnet/blob/master/bindsnet/encoding/encodings.py

Generates Poisson-distributed spike trains based on input intensity. Inputs must be non-negative, and give the firing rate in Hz. Inter-spike intervals (ISIs) for non-negative data incremented by one to avoid zero intervals while maintaining ISI distributions.

Parameters
  • datum – Tensor of shape [n_1, ..., n_k].

  • time – Length of Poisson spike train per input variable.

  • dt – Simulation time step.

Returns

Tensor of shape [time, n_1, ..., n_k] of Poisson-distributed spikes.

class pysnn.encoding.PoissonEncoder(duration, dt)

Encode a set of spiking intensities to spike trains using a Poisson distribution.

Adapted from:

https://github.com/Hananel-Hazan/bindsnet/blob/master/bindsnet/encoding/encodings.py

Creates a callable PoissonEncoder which encodes as defined in bindsnet.encoding.poisson

Parameters
  • time – Length of Poisson spike train per input variable.

  • dt – Simulation time step.