-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
114 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
mmpretrain/configs/swin_transformer_v2/swinv2_base_w16_16xb64_in1k_256px.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
# This is a BETA new format config file, and the usage may change recently. | ||
from mmengine.config import read_base | ||
from mmengine.model import ConstantInit, TruncNormalInit | ||
|
||
from mmpretrain.models import CutMix, Mixup | ||
|
||
with read_base(): | ||
from .._base_.datasets.imagenet_bs64_swin_256 import * | ||
from .._base_.default_runtime import * | ||
from .._base_.models.swin_transformer_v2_base import * | ||
from .._base_.schedules.imagenet_bs1024_adamw_swin import * | ||
|
||
model = dict(backbone=dict(window_size=[16, 16, 16, 8])) | ||
# model settings | ||
model.update( | ||
backbone=dict( | ||
img_size=256, drop_path_rate=0.5, window_size=[16, 16, 16, 8]), | ||
init_cfg=[ | ||
dict(type=TruncNormalInit, layer='Linear', std=0.02, bias=0.), | ||
dict(type=ConstantInit, layer='LayerNorm', val=1., bias=0.) | ||
], | ||
train_cfg=dict( | ||
augments=[dict(type=Mixup, alpha=0.8), | ||
dict(type=CutMix, alpha=1.0)])) |
18 changes: 13 additions & 5 deletions
18
mmpretrain/configs/swin_transformer_v2/swinv2_base_w16_in21k_pre_16xb64_in1k_256px.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
# This is a BETA new format config file, and the usage may change recently. | ||
from mmengine.config import read_base | ||
from mmengine.model import ConstantInit, TruncNormalInit | ||
|
||
from mmpretrain.models import ImageClassifier | ||
from mmpretrain.models import CutMix, Mixup | ||
|
||
with read_base(): | ||
from .._base_.datasets.imagenet_bs64_swin_256 import * | ||
from .._base_.default_runtime import * | ||
from .._base_.models.swin_transformer_v2_base import * | ||
from .._base_.schedules.imagenet_bs1024_adamw_swin import * | ||
|
||
model = dict( | ||
type=ImageClassifier, | ||
# model settings | ||
model.update( | ||
backbone=dict( | ||
img_size=256, | ||
window_size=[16, 16, 16, 8], | ||
drop_path_rate=0.2, | ||
pretrained_window_sizes=[12, 12, 12, 6])) | ||
pretrained_window_sizes=[12, 12, 12, 6]), | ||
init_cfg=[ | ||
dict(type=TruncNormalInit, layer='Linear', std=0.02, bias=0.), | ||
dict(type=ConstantInit, layer='LayerNorm', val=1., bias=0.) | ||
], | ||
train_cfg=dict( | ||
augments=[dict(type=Mixup, alpha=0.8), | ||
dict(type=CutMix, alpha=1.0)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
mmpretrain/configs/swin_transformer_v2/swinv2_small_w16_16xb64_in1k_256px.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
# This is a BETA new format config file, and the usage may change recently. | ||
from mmengine.config import read_base | ||
from mmengine.model import ConstantInit, TruncNormalInit | ||
|
||
from mmpretrain.models import CutMix, Mixup | ||
|
||
with read_base(): | ||
from .._base_.datasets.imagenet_bs64_swin_256 import * | ||
from .._base_.default_runtime import * | ||
from .._base_.models.swin_transformer_v2_base import * | ||
from .._base_.schedules.imagenet_bs1024_adamw_swin import * | ||
|
||
model = dict(backbone=dict(window_size=[16, 16, 16, 8])) | ||
# model settings | ||
model.update( | ||
backbone=dict( | ||
arch='small', | ||
img_size=256, | ||
drop_path_rate=0.3, | ||
window_size=[16, 16, 16, 8]), | ||
head=dict(in_channels=768), | ||
init_cfg=[ | ||
dict(type=TruncNormalInit, layer='Linear', std=0.02, bias=0.), | ||
dict(type=ConstantInit, layer='LayerNorm', val=1., bias=0.) | ||
], | ||
train_cfg=dict( | ||
augments=[dict(type=Mixup, alpha=0.8), | ||
dict(type=CutMix, alpha=1.0)])) |
19 changes: 18 additions & 1 deletion
19
mmpretrain/configs/swin_transformer_v2/swinv2_tiny_w16_16xb64_in1k_256px.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
# This is a BETA new format config file, and the usage may change recently. | ||
from mmengine.config import read_base | ||
from mmengine.model import ConstantInit, TruncNormalInit | ||
|
||
from mmpretrain.models import CutMix, Mixup | ||
|
||
with read_base(): | ||
from .._base_.datasets.imagenet_bs64_swin_256 import * | ||
from .._base_.default_runtime import * | ||
from .._base_.models.swin_transformer_v2_base import * | ||
from .._base_.schedules.imagenet_bs1024_adamw_swin import * | ||
|
||
model = dict(backbone=dict(window_size=[16, 16, 16, 8])) | ||
# model settings | ||
model.update( | ||
backbone=dict( | ||
arch='tiny', | ||
img_size=256, | ||
drop_path_rate=0.2, | ||
window_size=[16, 16, 16, 8]), | ||
head=dict(in_channels=768), | ||
init_cfg=[ | ||
dict(type=TruncNormalInit, layer='Linear', std=0.02, bias=0.), | ||
dict(type=ConstantInit, layer='LayerNorm', val=1., bias=0.) | ||
], | ||
train_cfg=dict( | ||
augments=[dict(type=Mixup, alpha=0.8), | ||
dict(type=CutMix, alpha=1.0)])) |