Skip to content

Commit 10d8fa4

Browse files
committed
Add gc and bat attention resnext26ts variants to byob for test.
1 parent 2a63d02 commit 10d8fa4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

timm/models/byobnet.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def _cfg(url='', **kwargs):
9898
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
9999
'gcresnet50t': _cfg(
100100
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
101+
102+
'gcresnext26ts': _cfg(
103+
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
104+
'bat_resnext26ts': _cfg(
105+
first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'),
101106
}
102107

103108

@@ -307,6 +312,37 @@ def interleave_blocks(
307312
stem_pool=None,
308313
attn_layer='gc'
309314
),
315+
316+
gcresnext26ts=ByoModelCfg(
317+
blocks=(
318+
ByoBlockCfg(type='bottle', d=3, c=256, s=1, gs=32, br=0.25),
319+
ByoBlockCfg(type='bottle', d=4, c=512, s=2, gs=32, br=0.25),
320+
ByoBlockCfg(type='bottle', d=6, c=1024, s=2, gs=32, br=0.25),
321+
ByoBlockCfg(type='bottle', d=3, c=2048, s=2, gs=32, br=0.25),
322+
),
323+
stem_chs=64,
324+
stem_type='tiered',
325+
stem_pool='maxpool',
326+
num_features=0,
327+
act_layer='silu',
328+
attn_layer='gc',
329+
),
330+
331+
bat_resnext26ts=ByoModelCfg(
332+
blocks=(
333+
ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=32, br=0.25),
334+
ByoBlockCfg(type='bottle', d=2, c=512, s=2, gs=32, br=0.25),
335+
ByoBlockCfg(type='bottle', d=2, c=1024, s=2, gs=32, br=0.25),
336+
ByoBlockCfg(type='bottle', d=2, c=2048, s=2, gs=32, br=0.25),
337+
),
338+
stem_chs=64,
339+
stem_type='tiered',
340+
stem_pool='maxpool',
341+
num_features=0,
342+
act_layer='silu',
343+
attn_layer='bat',
344+
attn_kwargs=dict(block_size=8)
345+
),
310346
)
311347

312348

@@ -426,6 +462,20 @@ def gcresnet50t(pretrained=False, **kwargs):
426462
return _create_byobnet('gcresnet50t', pretrained=pretrained, **kwargs)
427463

428464

465+
@register_model
466+
def gcresnext26ts(pretrained=False, **kwargs):
467+
"""
468+
"""
469+
return _create_byobnet('gcresnext26ts', pretrained=pretrained, **kwargs)
470+
471+
472+
@register_model
473+
def bat_resnext26ts(pretrained=False, **kwargs):
474+
"""
475+
"""
476+
return _create_byobnet('bat_resnext26ts', pretrained=pretrained, **kwargs)
477+
478+
429479
def expand_blocks_cfg(stage_blocks_cfg: Union[ByoBlockCfg, Sequence[ByoBlockCfg]]) -> List[ByoBlockCfg]:
430480
if not isinstance(stage_blocks_cfg, Sequence):
431481
stage_blocks_cfg = (stage_blocks_cfg,)

0 commit comments

Comments
 (0)