mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Add gc and bat attention resnext26ts variants to byob for test.
This commit is contained in:
parent
2a63d0246b
commit
10d8fa4620
@ -98,6 +98,11 @@ default_cfgs = {
|
||||
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
|
||||
'gcresnet50t': _cfg(
|
||||
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
|
||||
|
||||
'gcresnext26ts': _cfg(
|
||||
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
|
||||
'bat_resnext26ts': _cfg(
|
||||
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
|
||||
}
|
||||
|
||||
|
||||
@ -307,6 +312,37 @@ model_cfgs = dict(
|
||||
stem_pool=None,
|
||||
attn_layer='gc'
|
||||
),
|
||||
|
||||
gcresnext26ts=ByoModelCfg(
|
||||
blocks=(
|
||||
ByoBlockCfg(type='bottle', d=3, c=256, s=1, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=4, c=512, s=2, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=6, c=1024, s=2, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=3, c=2048, s=2, gs=32, br=0.25),
|
||||
),
|
||||
stem_chs=64,
|
||||
stem_type='tiered',
|
||||
stem_pool='maxpool',
|
||||
num_features=0,
|
||||
act_layer='silu',
|
||||
attn_layer='gc',
|
||||
),
|
||||
|
||||
bat_resnext26ts=ByoModelCfg(
|
||||
blocks=(
|
||||
ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=2, c=512, s=2, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=2, c=1024, s=2, gs=32, br=0.25),
|
||||
ByoBlockCfg(type='bottle', d=2, c=2048, s=2, gs=32, br=0.25),
|
||||
),
|
||||
stem_chs=64,
|
||||
stem_type='tiered',
|
||||
stem_pool='maxpool',
|
||||
num_features=0,
|
||||
act_layer='silu',
|
||||
attn_layer='bat',
|
||||
attn_kwargs=dict(block_size=8)
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@ -426,6 +462,20 @@ def gcresnet50t(pretrained=False, **kwargs):
|
||||
return _create_byobnet('gcresnet50t', pretrained=pretrained, **kwargs)
|
||||
|
||||
|
||||
@register_model
|
||||
def gcresnext26ts(pretrained=False, **kwargs):
|
||||
"""
|
||||
"""
|
||||
return _create_byobnet('gcresnext26ts', pretrained=pretrained, **kwargs)
|
||||
|
||||
|
||||
@register_model
|
||||
def bat_resnext26ts(pretrained=False, **kwargs):
|
||||
"""
|
||||
"""
|
||||
return _create_byobnet('bat_resnext26ts', pretrained=pretrained, **kwargs)
|
||||
|
||||
|
||||
def expand_blocks_cfg(stage_blocks_cfg: Union[ByoBlockCfg, Sequence[ByoBlockCfg]]) -> List[ByoBlockCfg]:
|
||||
if not isinstance(stage_blocks_cfg, Sequence):
|
||||
stage_blocks_cfg = (stage_blocks_cfg,)
|
||||
|
Loading…
x
Reference in New Issue
Block a user