To dynamically aggregate tokens, Wave-MLP proposes to represent each token as a wave function with two parts, amplitude and phase. Amplitude is the original feature and the phase term is a complex value changing according to the semantic contents of input images.
Paper: Yehui Tang, Kai Han, Jianyuan Guo, Chang Xu, Yanxi Li, Chao Xu, Yunhe Wang. An Image Patch is a Wave: Phase-Aware Vision MLP. arxiv 2111.12294.
A block of Wave-MLP is shown below:
Dataset used: [ImageNet2012]
WalveMlp
├── eval.py # inference entry
├── fig
│ └── wavemlp.png # the illustration of wave_mlp network
├── readme.md # Readme
└── src
├── dataset.py # dataset loader
└── wave_mlp.py # wave_mlp network
After installing MindSpore via the official website, you can start evaluation as follows:
# infer example
# python
GPU: python eval.py --dataset_path dataset --platform GPU --checkpoint_path [CHECKPOINT_PATH]
# shell
bash ./scripts/run_eval.sh [DATA_PATH] [PLATFORM] [CHECKPOINT_PATH]
checkpoint can be downloaded at https://download.mindspore.cn/model_zoo/research/cv/wavemlp/.
result: {'acc': 0.807} ckpt= ./WaveMLP_T.ckpt
Parameters | Ascend |
---|---|
Model Version | WaveMlp |
Resource | Ascend 910; OS Euler2.8 |
Uploaded Date | 08/03/2022 (month/day/year) |
MindSpore Version | 1.6.0 |
Dataset | ImageNet2012 |
batch_size | 1024 |
outputs | probability |
Accuracy | 1pc: 80.7% |
Speed | 1pc: 11.72 s/step |
Total time | 1pc: 562.96 s/step |
In dataset.py, we set the seed inside "create_dataset" function. We also use random seed in train.py.
Please check the official homepage.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。