Spike manipulation and augmentation
Project description
Telluride Spike Data Augmentation toolkit
This repository contains a pipeline of data augmentation methods, the effect of which will be tested on various data sets and SOA methods for event- and spike-based data. The goal is to reduce overfitting in learning algorithms by providing implementations of data augmentation methods for event/spike recordings.
Quickstart
In a terminal: clone this repo and install it
git clone git@github.com:neuromorphs/tonic.git
cd tonic
pip install -e .
In a Python file: choose transforms, a data set and whether you want shuffling enabled!
import tonic
import tonic.transforms as transforms
transform = transforms.Compose([transforms.TimeJitter(variance=10),
transforms.FlipLR(flip_probability=0.5),
transforms.ToTimesurface(surface_dimensions=(7,7), tau=5e3),])
testset = tonic.datasets.NMNIST(save_to='./data',
train=False,
transform=transform)
testloader = tonic.datasets.Dataloader(testset, shuffle=True)
for surfaces, target in iter(testloader):
print("{0} surfaces for target {1}".format(len(surfaces), target))
Documentation
To see a list of all transforms and their possible parameters, it is necessary to build documentation locally. Just run the following commands to do that:
cd docs
make html
firefox _build/html/index.html
Possible data sets (asterix marks currently supported in this package)
- MVSEC
- NMNIST (*)
- ASL-DVS
- NCARS(*)
- N-CALTECH 101(*)
- POKER-DVS (*)
- IBM gestures (*)
- TI Digits
- TIMIT
Algorithms
Contribute
Install pre-commit
pip install pre-commit
pre-commit install
This will install the black formatter to a pre-commit hook. When you use git add
you add files to the current commit, then when you run git commit
the black formatter will run BEFORE the commit itself. If it fails the check, the black formatter will format the file and then present it to you to add it into your commit. Simply run git add
on those files again and do the remainder of the commit as normal.
Run tests
To install pytest
pip install pytest
To run the tests, from the root directory of the repo
python -m pytest test/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.