Dataset¶
Dataset wrapper for use with SLAYER.
-
class
slayerSNN.auto.dataset.
SlayerDataset
(dataset, network, randomShift=False, binningMode='OR', fullDataset=False)[source]¶ This class wraps a basic dataset class to be used in SLAYER training. This allows the use of the same basic dataset definition on some other platform other than SLAYER, for e.g. for implementation in a neuromorphic hardware with its SDK.
The basic dataset must return a numpy array of events where each row consists of an AER event represented by x, y, polarity and time (in ms).
- Arguments:
dataset
: basic dataset to be wrapped.network
: anauto
module network with which the dataset is intended to be used with.The shape of the tensor is determined from the netowrk definition.
randomShift
: a flag to indicate if the sample must be randomly shifted in time over theentire sample length. Default: False
binningMode
: the way the overlapping events are binned. SupportsSUM
andOR
binning.Default:
OR
fullDataset
: a flag that indicates weather the full dataset is to be processed or not.If
True
, full length of the events is loaded into tensor. This will cause problems with default batching, as the number of time bins will not match for all the samples in a minibatch. In this case, the dataloader’scollate_fn
must be custom defined or a batch size of 1 should be used. Default:False
Usage:
dataset = SlayerDataset(dataset, net)