spyx.loaders
#
Module Contents#
Classes#
Dataloader for the MNIST dataset. The data is returned in a packed format after using the pixel intensities as the p-value for sampling from |
|
Dataloading wrapper for the Neuromorphic MNIST dataset. |
|
Dataloading wrapper for the Spiking Heidelberg Dataset. The entire dataset is loaded to vRAM in a temporally compressed format. The user must |
Attributes#
- spyx.loaders.optional_dependencies_installed = True#
- spyx.loaders.State#
- class spyx.loaders.MNIST_loader(batch_size=32, sample_T=64, max_rate=0.75, val_size=0.3, data_subsample=1, key=0, download_dir='./MNIST')[source]#
Dataloader for the MNIST dataset. The data is returned in a packed format after using the pixel intensities as the p-value for sampling from a Bernoulli distribution.
- Batch_size:
Number of samples per batch.
- Sample_T:
Length of the time axis for each sample.
- Max_rate:
Maximum number of spikes possible.
- Val_size:
Fraction of the training set to set aside for validation.
- Data_subsample:
use a subsample of the training/validation data to reduce computational demand.
- Key:
An integer for setting the dataset loading random state.
- Download_dir:
The directory to download the dataset to.
- class spyx.loaders.NMNIST_loader(batch_size=32, sample_T=40, data_subsample=1, val_size=0.3, key=0, download_dir='./NMNIST')[source]#
Dataloading wrapper for the Neuromorphic MNIST dataset.
- Batch_size:
Samples per batch.
- Sample_T:
Timesteps per sample/length of time axis.
- Data_subsample:
Use a fraction of the training/validation sets to reduce computational demand.
- Val_size:
Proportion of dataset to set aside for validation.
- Key:
Integer specifying the random seed for the train/val split.
- Download_dir:
The local directory to save the data to.
- class spyx.loaders.SHD_loader(batch_size=256, sample_T=128, channels=128, val_size=0.2)[source]#
Dataloading wrapper for the Spiking Heidelberg Dataset. The entire dataset is loaded to vRAM in a temporally compressed format. The user must apply jnp.unpackbits(events, axis=<time axis>) prior to feeding to an SNN.
https://zenkelab.org/resources/spiking-heidelberg-datasets-shd/
- Batch_size:
Number of samples per batch.
- Sample_T:
Number of time steps per sample.
- Channels:
Number of frequency channels used.
- Val_size:
Fraction of the training dataset to set aside for validation.