levit-256-p16.py 668 Bytes
Newer Older
renzhc's avatar
renzhc committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# model settings
model = dict(
    type='ImageClassifier',
    backbone=dict(
        type='LeViT',
        arch='256',
        img_size=224,
        patch_size=16,
        drop_path_rate=0,
        attn_ratio=2,
        mlp_ratio=2,
        out_indices=(2, )),
    neck=dict(type='GlobalAveragePooling'),
    head=dict(
        type='LeViTClsHead',
        num_classes=1000,
        in_channels=512,
        distillation=True,
        loss=dict(
            type='LabelSmoothLoss', label_smooth_val=0.1, loss_weight=1.0),
        topk=(1, 5),
    ),
    train_cfg=dict(augments=[
        dict(type='Mixup', alpha=0.8),
        dict(type='CutMix', alpha=1.0),
    ]))