Glassatlas / Spiking-Neural-Network

Vanilla spiking Neural Network using Pytorch
0 stars 0 forks source link

Neuromorphic Dataset #1

Open tehreemnaqvi opened 4 years ago

tehreemnaqvi commented 4 years ago

Hi,

I just started to work on Neuromorphic datasets.

I am using the PyTorch framework for SNN and using Garrick Orchard codes as a reference.

But I am confused about how to read spikes in PyTorch dataloders because he used a slayer framework to read spikes. Can you please tell me how I read spikes using PyTorch dataloader.

Your help will be appreciated.

Thanks

Glassatlas commented 4 years ago

Dear Tehreem,

So Garrick Orchard did provide python code for working with neuromorphic dataset in https://github.com/gorchard/event-Python (they were written in older python version so you might need a bit of fixing if you are using Python 3+). Neuromorphic dataset and Eventvision are the two mod that you want to take a look at. This is the main function that will read the dataset.

TD = read_dataset(filename): Reads in the TD events contained in the N-MNIST/N-CALTECH101 dataset file specified by 'filename'

Also, there is an SNN simulation that is built on PyTorch which provide a base class for reading neuromorphic dataset called "PySNN", which can be found here: https://github.com/BasBuller/PySNN It is also based on Garrick's python code as well. Check on their io and datasets page.

This is an example of using pysnn.dataset on pytorch dataloader. root = "nmnist" if os.path.isdir(root): train_dataset, test_dataset = nmnist_train_test(root) else: raise NotADirectoryError( "Make sure to download the N-MNIST dataset from https://www.garrickorchard.com/datasets/n-mnist and put it in the 'nmnist' folder." ) train_dataloader = DataLoader( train_dataset, batch_size=batch_size, shuffle=True, num_workers=num_workers ) test_dataloader = DataLoader( test_dataset, batch_size=batch_size, shuffle=True, num_workers=num_workers ) However, as I mentioned, Garrick's python code is probably the main one if you want to do everything yourself from scratch. I've been using only PySNN recently as they provided quite a nice framework. Hope this helps!

Best, Puttatida M.

On Sun, Jul 12, 2020 at 5:09 AM tehreemnaqvi notifications@github.com wrote:

Hi,

I just started to work on Neuromorphic datasets.

I am using the PyTorch framework for SNN and using Garrick Orchard codes as a reference.

But I am confused about how to read spikes in PyTorch dataloders because he used a slayer framework to read spikes. Can you please tell me how I read spikes using PyTorch dataloader.

Your help will be appreciated.

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Glassatlas/Spiking-Neural-Network/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIWSAFAGAYEPUNPSQYZ4ETR3EZOFANCNFSM4OXTTCXQ .

-- Kind regards, Puttatida Mahapattanakul Edinburgh, United Kingdom

Mobile: +44 790 419 0752