108 Star 871 Fork 1.5K

MindSpore/models

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

Contents

SNN-MLP Description

To efficiently communicate between tokens, we incorporate the mechanism of LIF neurons into the MLP models, and achieve better accuracy without extra FLOPs.

Paper: Wenshuo Li, Hanting Chen, Jianyuan Guo, Ziyang Zhang, Yunhe Wang. Brain-inspired Multilayer Perceptron with Spiking Neurons. arxiv 2203.14679.

Model architecture

A block of SNN-MLP is shown below:

image-20211026160438718

Dataset

Dataset used: ImageNet2012

  • Dataset size 224*224 colorful images in 1000 classes
    • Train: 1,281,167 images
    • Test: 50,000 images
  • Data format: jpeg
    • Note: Data will be processed in dataset.py

Environment Requirements

Script description

Script and sample code


SNN-MLP
├── eval.py # inference entry
├── fig
│   └── snnmlp.png # the illustration of snn_mlp network
├── readme.md # Readme
└── src
    ├── dataset.py # dataset loader
    └── snn_mlp.py # snn_mlp network

Eval process

Usage

After installing MindSpore via the official website, you can start evaluation as follows:

Launch


# infer example
  python eval.py --dataset_path [DATASET] --platform GPU --checkpoint_path [CHECKPOINT_PATH] --model [snnmlp_t|snnmlp_s|snnmlp_b] #GPU

checkpoint can be downloaded at https://download.mindspore.cn/model_zoo/research/cv/snn_mlp/.

Result


result: {'acc': 0.8185} ckpt= ./SNNMLP_T.ckpt

Description of Random Situation

In dataset.py, we set the seed inside "create_dataset" function. We also use random seed in train.py.

ModelZoo Homepage

Please check the official homepage.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mindspore/models.git
git@gitee.com:mindspore/models.git
mindspore
models
models
master

Search