https://github.com/rentainhe/vision-mlp-oneflow
Vision MLP Models Based on OneFlow
https://github.com/rentainhe/vision-mlp-oneflow
mlp vision
Last synced: 9 months ago
JSON representation
Vision MLP Models Based on OneFlow
- Host: GitHub
- URL: https://github.com/rentainhe/vision-mlp-oneflow
- Owner: rentainhe
- License: mit
- Created: 2021-07-12T08:00:49.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-25T03:30:46.000Z (almost 5 years ago)
- Last Synced: 2025-03-26T05:11:15.622Z (about 1 year ago)
- Topics: mlp, vision
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vision-mlp-oneflow
Vision MLP Models Based on OneFlow
## TODO LIST
- [x] [Mlp-Mixer]()
- [x] [ResMLP]()
- [x] [gMLP]()
- [ ] [S2-MLP]()
- [x] [Vision-Permutator]()
## 复现过程中遇到的问题
- `tensor.chunk()`方法没有和`torch.tensor.chunk()`对齐, 在输入的dim参数为负数的时候未作判断, 并且整体功能还变成了repeat操作
- 缺少`tensor.floor_()`方法, 只能用`tensor = tensor.floor()`替代
- 缺少`tensor.erfinv()`方法及其inplace版本, 无法复现`trunc_norm_`
- 缺少`tensor.new_empty()`方法
- `flow.shape`返回的是`oneflow._oneflow_internal.Size` 无法和 `tuple`相加, 按以下方法使用会报错:
```python
# oneflow里报错
x = flow.tensor(np.random.randn(1, 16, 512), dtype=flow.float32)
x.shape + (4, )
x.size() + (4, )
>>>TypeError: unsupported operand type(s) for +: 'oneflow._oneflow_internal.Size' and 'tuple'
# torch里不报错
x = torch.randn(1, 16, 512)
x.shape + (4, )
x.size() + (4, )
>>> torch.Size([1, 16, 512, 4])
```
- `tensor.gather()`未具体判定输入的dim为负数的情况