From a8b65695f129322fc4ad312123c318ba19f1698c Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Sat, 21 Aug 2021 12:42:10 -0700 Subject: [PATCH] Add resnet26ts and resnext26ts models for non-attn baselines --- timm/models/byobnet.py | 48 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/timm/models/byobnet.py b/timm/models/byobnet.py index cbd0ac0a..add07b2f 100644 --- a/timm/models/byobnet.py +++ b/timm/models/byobnet.py @@ -95,6 +95,8 @@ default_cfgs = { 'resnet61q': _cfg( first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'), + 'resnext26ts': _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'), 'seresnext26ts': _cfg( @@ -105,6 +107,8 @@ default_cfgs = { first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic', min_input_size=(3, 256, 256)), + 'resnet26ts': _cfg( + first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'), 'gcresnet26ts': _cfg( first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'), 'seresnet26ts': _cfg( @@ -311,8 +315,21 @@ model_cfgs = dict( attn_kwargs=dict(extent=8, extra_params=True), ), - # A series of ResNeXt-26 models w/ one of GC, SE, ECA, BAT attn, group size 32, SiLU act, + # A series of ResNeXt-26 models w/ one of none, GC, SE, ECA, BAT attn, group size 32, SiLU act, # and a tiered stem w/ maxpool + 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', + ), gcresnext26ts=ByoModelCfg( blocks=( ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=32, br=0.25), @@ -371,8 +388,21 @@ model_cfgs = dict( attn_kwargs=dict(block_size=8) ), - # A series of ResNet-26 models w/ one of GC, SE, ECA attn, no groups, SiLU act, 1280 feat fc + # A series of ResNet-26 models w/ one of none, GC, SE, ECA attn, no groups, SiLU act, 1280 feat fc # and a tiered stem w/ no maxpool + resnet26ts=ByoModelCfg( + blocks=( + ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=3, c=512, s=2, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=3, c=1536, s=2, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=2, c=1536, s=2, gs=0, br=0.25), + ), + stem_chs=64, + stem_type='tiered', + stem_pool='', + num_features=0, + act_layer='silu', + ), gcresnet26ts=ByoModelCfg( blocks=( ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=0, br=0.25), @@ -548,6 +578,13 @@ def resnet61q(pretrained=False, **kwargs): return _create_byobnet('resnet61q', pretrained=pretrained, **kwargs) +@register_model +def resnext26ts(pretrained=False, **kwargs): + """ + """ + return _create_byobnet('resnext26ts', pretrained=pretrained, **kwargs) + + @register_model def gcresnext26ts(pretrained=False, **kwargs): """ @@ -576,6 +613,13 @@ def bat_resnext26ts(pretrained=False, **kwargs): return _create_byobnet('bat_resnext26ts', pretrained=pretrained, **kwargs) +@register_model +def resnet26ts(pretrained=False, **kwargs): + """ + """ + return _create_byobnet('resnet26ts', pretrained=pretrained, **kwargs) + + @register_model def gcresnet26ts(pretrained=False, **kwargs): """