Skip to main content

Neuromorphic datasets and transformations.

Project description

tonic PyPI codecov Documentation Status contributors Binder DOI Discord

Tonic is a tool to facilitate the download, manipulation and loading of event-based/spike-based data. It's like PyTorch Vision but for neuromorphic data!

Documentation

You can find the full documentation on Tonic on this site.

Install

pip install tonic

or (thanks to @Tobias-Fischer)

conda install -c conda-forge tonic

For the latest pre-release on the develop branch that passed the tests:

pip install tonic --pre

This package has been tested on:

Linux
Windows

Quickstart

If you're looking for a minimal example to run, this is it!

import tonic
import tonic.transforms as transforms

sensor_size = tonic.datasets.NMNIST.sensor_size
transform = transforms.Compose(
    [
        transforms.Denoise(filter_time=10000),
        transforms.ToFrame(sensor_size=sensor_size, time_window=3000),
    ]
)

testset = tonic.datasets.NMNIST(save_to="./data", train=False, transform=transform)

from torch.utils.data import DataLoader

testloader = DataLoader(
    testset,
    batch_size=10,
    collate_fn=tonic.collation.PadTensors(batch_first=True),
)

frames, targets = next(iter(testloader))

Discussion and questions

Have a question about how something works? Ideas for improvement? Feature request? Please get in touch on the #tonic Discord channel or alternatively here on GitHub via the Discussions page!

Contributing

Please check out the contributions page for details.

Sponsoring

The development of this library is supported by

SynSense

Citation

If you find this package helpful, please consider citing it:

@software{lenz_gregor_2021_5079802,
  author       = {Lenz, Gregor and
                  Chaney, Kenneth and
                  Shrestha, Sumit Bam and
                  Oubari, Omar and
                  Picaud, Serge and
                  Zarrella, Guido},
  title        = {Tonic: event-based datasets and transformations.},
  month        = jul,
  year         = 2021,
  note         = {{Documentation available under 
                   https://tonic.readthedocs.io}},
  publisher    = {Zenodo},
  version      = {0.4.0},
  doi          = {10.5281/zenodo.5079802},
  url          = {https://doi.org/10.5281/zenodo.5079802}
}

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.

Source Distribution

tonic-1.4.3.dev2.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tonic-1.4.3.dev2-py3-none-any.whl (111.9 kB view details)

Uploaded Python 3

File details

Details for the file tonic-1.4.3.dev2.tar.gz.

File metadata

  • Download URL: tonic-1.4.3.dev2.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tonic-1.4.3.dev2.tar.gz
Algorithm Hash digest
SHA256 00dba4a4afc294992fbb7f58c64fd4cecf4231674fa5f6bf6dacfa42dbcf58b7
MD5 b6d124ff8b3174c909890e261781bffb
BLAKE2b-256 1d7269a7c4cc22ce9cbef6864c03a588d278c2fde2087ed88496e2ed20bfa893

See more details on using hashes here.

File details

Details for the file tonic-1.4.3.dev2-py3-none-any.whl.

File metadata

  • Download URL: tonic-1.4.3.dev2-py3-none-any.whl
  • Upload date:
  • Size: 111.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for tonic-1.4.3.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a5ce36c2e5a06fc2eb45de212c016b976897d76c273b07f2c0c0f806bbec30c
MD5 0826dc6408e9bfd14f7333256b3936f3
BLAKE2b-256 6898c8e7da7293848f306b8c1c240a1ba54db9dba77d433fb6a2dd39200fac9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page