108 Star 867 Fork 1.5K

MindSpore/models

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Contents

Aug-ViT Description

Aug-ViT inserts additional paths with learnable parameters in parallel on the original shortcuts for alleviating the feature collapse. The block-circulant projection is used to implement augmented shortcut, which brings negligible increase of computational cost.

Paper: Yehui Tang, Kai Han, Chang Xu, An Xiao, Yiping Deng, Chao Xu, Yunhe Wang. Augmented Shortcuts for Vision Transformers. NeurIPS 2021.

Model architecture

A block of Aug-ViT is show below:

image-20211026160438718

Dataset

Dataset used: CIFAR-10

  • Dataset size: 60000 colorful images in 10 classes
    • Train: 50000 images
    • Test: 10000 images
  • Data format: RGB images.

Environment Requirements

Script description

Script and sample code

AugViT
├── eval.py # inference entry
├── fig
│   └── augvit.png # the illustration of augvit network
├── readme.md # Readme
└── src
    ├── config.py # config of model and data
    ├── c10_dataset.py # dataset loader
    └── augvit.py # augvit network

Eval process

Usage

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

Launch

# infer example
  GPU: python eval.py --model augvit_s --dataset_path cifar_dataset --platform GPU --checkpoint_path [CHECKPOINT_PATH]

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

Result

result: {'acc': 0.98} ckpt= ./augvit_c10.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

搜索帮助