hxtorch.spiking.transforms.encode.SpikeTimesToDense

class hxtorch.spiking.transforms.encode.SpikeTimesToDense(bin_width: float, size: int = 100)

Bases: torch.nn.modules.module.Module

Convert spike times to a dense matrix of zeros and ones

__init__(bin_width: float, size: int = 100)None

Initialize the conversion of spike times to a dense matrix of zeros and ones.

Parameters
  • bin_width – Binning interval in seconds.

  • size – number of bins along time axis.

Methods

__init__(bin_width[, size])

Initialize the conversion of spike times to a dense matrix of zeros and ones.

forward(spikes)

Convert spike times to dense matrix of zeros and ones.

Attributes

forward(spikes: torch.Tensor)torch.Tensor

Convert spike times to dense matrix of zeros and ones.

Parameters

spikes – Spike times of shape ‘(color_channels, x0[, x1, …])’.

Returns

Returns a dense matrix of shape ‘(time_bins, color_channels, x0[, x1, …])’.

training: bool