szwlh-c c98dc4555c
[Feature] Support VIG Backbone. (#1304)
* 添加vig源文件

* 某些模块修改到mmcls风格

* 修改到mmcls风格

* 修改

* 添加VIG模型及源文件

* update model file

* update model file and config

* change class name and some variable name

* change class name and some variable name

* update

* update

* change nn.BatchNorm to mmcv.cnn.build_norm_layer

* update

* change nn.Seq to mmcls

* change backbone to stage_blocks

* add vig_head

* update

* update config file

* update

* add readme and metafile

* update model-index.yml

* update model file

* rename config file and add docstring

* variable rename

* update readme and metafile

* update readme

* update

* Update VIG backbone implementation and docs.

* Fix configs.

Co-authored-by: mzr1996 <mzr1996@163.com>
2023-01-17 16:55:56 +08:00

34 lines
848 B
Python

model = dict(
type='ImageClassifier',
backbone=dict(
type='Vig',
arch='tiny',
k=9,
act_cfg=dict(type='GELU'),
norm_cfg=dict(type='BN'),
graph_conv_type='mr',
graph_conv_bias=True,
epsilon=0.2,
use_dilation=True,
use_stochastic=False,
drop_path=0.1,
relative_pos=False,
norm_eval=False,
frozen_stages=0),
neck=dict(type='GlobalAveragePooling'),
head=dict(
type='VigClsHead',
num_classes=1000,
in_channels=192,
hidden_dim=1024,
act_cfg=dict(type='GELU'),
dropout=0.,
loss=dict(type='CrossEntropyLoss', loss_weight=1.0),
topk=(1, 5),
),
train_cfg=dict(augments=[
dict(type='Mixup', alpha=0.8),
dict(type='CutMix', alpha=1.0)
]),
)