GithubHelp home page GithubHelp logo

phelixh / ann2snn_gn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lyu6poshao/ann2snn_gn

0.0 0.0 0.0 48 KB

Here is the official code for ICASSP 2024 "Optimal ANN-SNN Conversion with Group Neurons".

Python 100.00%

ann2snn_gn's Introduction

arXiv

Here is the official code for ICASSP 2024 "Optimal ANN-SNN Conversion with Group Neurons".

We achieve outstanding accuracy with limited time-steps (e.g. ResNet34 on ImageNet1000: 73.61% when T=2).

Before using

You should install SpikingJelly first:

pip install spikingjelly

Demo

# !sh
#Train ANN with QCFS.

gpus=8
bs=160
lr=0.1
epochs=120
l=8
data='cifar100'
model='resnet20'
id=${model}-${data}

python main.py  train \
    --gpus=$gpus \
    --bs=$bs \
    --lr=$lr \
    --epochs=$epochs \
    --l=$l \
    --model=$model \
    --data=$data \
    --id=$id \
# !sh
#Convert the trained ANN to SNN, and test the SNN.

gpus=8
bs=128
l=8
data='cifar100'
model='resnet20'
id='your ANN checkpoint id'
mode='ann'
sn_type='gn'  #'gn' means group neuron; 'if' means IF neuron
tau=6
t=32
device='cuda'
seed=42

python main.py  test \
    --gpus=$gpus \
    --bs=$bs \
    --l=$l \
    --model=$model \
    --data=$data \
    --mode=$mode  \
    --id=$id \
    --sn_type=$sn_type \
    --tau=$tau \
    --t=$t \
    --device=$device \
    --seed=$seed

ann2snn_gn's People

Contributors

lyu6poshao 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.