Giter Site home page Giter Site logo

tcja's Introduction

TCJA-SNN: Temporal-Channel Joint Attention for Spiking Neural Networks

How to Run

First clone the repository.

git clone https://github.com/ridgerchu/TCJA
cd TCJA
pip install -r requirements.txt

Train DVS128

Detailed usage of the script could be found in the source file.

python src/dvs128.py -data_dir /path/to/DVSGesture -out_dir runs/dvs128/ -opt Adam -device cuda:0 -lr_scheduler CosALR -T_max 1024 -T 20 -epochs 1024 -b 16 -lr 0.001 -amp -j 20

and the dataset folder DVSGesture should look like:

DVSGesture
├── download
│   ├── DvsGesture.tar.gz
│   ├── gesture_mapping.csv
│   ├── LICENSE.txt
│   ├── README.txt
│   ├── trials_to_test.txt
│   └── trials_to_train.txt
├── DVS128_frames_number_20_split_by_number.zip
├── DVSGesture.zip
├── events_np
│   ├── test
│   └── train
├── extract
│   └── DvsGesture
├── frames_number_100_split_by_number
│   ├── test
│   └── train
├── frames_number_10_split_by_number
│   ├── test
│   └── train
...

Train N-Caltech 101

python src/caltech101.py -data_dir /path/to/NCAL101/ -out_dir runs/caltech101 -opt Adam -device cuda:0 -lr_scheduler CosALR -T_max 1024 -T 14 -epochs 1024 -b 16 -lr 0.001 -j 20 -loss mse -amp

The NCAL101 looks like

NCAL101
├── events_np
├── extract
├── frames_number_14_split_by_number
└── NCAL101_frames_number_14_split_by_number.zip

Train CIFAR10-DVS

python src/cifar10dvs.py -data_dir /path/to/CIFAR10DVS/ -out_dir runs/cifar10dvs -opt Adam -device cuda:1 -lr_scheduler CosALR -T_max 1024 -T 20 -epochs 1024 -b 16 -lr 0.001 -j 20

The CIFAR10DVS looks like

CIFAR10DVS/
├── events_np
├── extract
├── extract.zip
├── frames_number_10_split_by_number
├── frames_number_10_split_by_number.zip
├── frames_number_16_split_by_number
├── frames_number_20_split_by_number
└── frames_number_20_split_by_number.zip

If you find TCJA module useful in your work, please cite the following source:

@article{zhu2022tcja,
  title={TCJA-SNN: Temporal-Channel Joint Attention for Spiking Neural Networks},
  author={Zhu, Rui-Jie and Zhao, Qihang and Zhang, Tianjing and Deng, Haoyu and Duan, Yule and Zhang, Malu and Deng, Liang-Jian},
  journal={arXiv preprint arXiv:2206.10177},
  year={2022}
}

tcja's People

Contributors

duanyll avatar ridgerchu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.