This is a modified version of fastai's XResNet model in github. Changes include:

xresnet1d18[source]

xresnet1d18(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d34[source]

xresnet1d34(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d50[source]

xresnet1d50(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d101[source]

xresnet1d101(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d152[source]

xresnet1d152(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d18_deep[source]

xresnet1d18_deep(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d34_deep[source]

xresnet1d34_deep(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d50_deep[source]

xresnet1d50_deep(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d18_deeper[source]

xresnet1d18_deeper(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d34_deeper[source]

xresnet1d34_deeper(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

xresnet1d50_deeper[source]

xresnet1d50_deeper(c_in, c_out, act=ReLU, stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sa=False, sym=False, norm_type=<NormType.Batch: 1>, act_cls=ReLU, ndim=2, ks=3, pool=AvgPool, pool_first=True, padding=None, bias=None, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros')

bs, c_in, seq_len = 2, 4, 32
c_out = 2
x = torch.rand(bs, c_in, seq_len)
archs = [
    xresnet1d18, xresnet1d34, xresnet1d50, 
    xresnet1d18_deep, xresnet1d34_deep, xresnet1d50_deep, xresnet1d18_deeper,
    xresnet1d34_deeper, xresnet1d50_deeper
#     # Long test
#     xresnet1d101, xresnet1d152,
]
for i, arch in enumerate(archs):
    print(i, arch.__name__)
    test_eq(arch(c_in, c_out, sa=True, act=Mish)(x).shape, (bs, c_out))
0 xresnet1d18
1 xresnet1d34
2 xresnet1d50
3 xresnet1d18_deep
4 xresnet1d34_deep
5 xresnet1d50_deep
6 xresnet1d18_deeper
7 xresnet1d34_deeper
8 xresnet1d50_deeper
m = xresnet1d34(4, 2, act=Mish)
test_eq(len(get_layers(m, is_bn)), 38)
test_eq(check_weight(m, is_bn)[0].sum(), 22)