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

class XResNet1dPlus[source]

XResNet1dPlus(block, expansion, layers, fc_dropout=0.0, c_in=3, n_out=1000, stem_szs=(32, 32, 64), widen=1.0, sa=False, act_cls=ReLU, ks=3, stride=2, coord=False, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sym=False, norm='Batch', zero_norm=True, pool=AvgPool, pool_first=True, padding=None, bias=None, ndim=2, norm_type=<NormType.Batch: 1>, bn_1st=True, transpose=False, init='auto', xtra=None, bias_std=0.01, dilation:Union[int, Tuple[int, int]]=1, padding_mode:str='zeros') :: Sequential

A sequential container. Modules will be added to it in the order they are passed in the constructor. Alternatively, an ordered dict of modules can also be passed in.

To make it easier to understand, here is a small example::

# Example of using Sequential
model = nn.Sequential(
          nn.Conv2d(1,20,5),
          nn.ReLU(),
          nn.Conv2d(20,64,5),
          nn.ReLU()
        )

# Example of using Sequential with OrderedDict
model = nn.Sequential(OrderedDict([
          ('conv1', nn.Conv2d(1,20,5)),
          ('relu1', nn.ReLU()),
          ('conv2', nn.Conv2d(20,64,5)),
          ('relu2', nn.ReLU())
        ]))

xresnet1d18plus[source]

xresnet1d18plus(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')

xresnet1d34plus[source]

xresnet1d34plus(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')

xresnet1d50plus[source]

xresnet1d50plus(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')

xresnet1d101plus[source]

xresnet1d101plus(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')

xresnet1d152plus[source]

xresnet1d152plus(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_deepplus[source]

xresnet1d18_deepplus(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_deepplus[source]

xresnet1d34_deepplus(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_deepplus[source]

xresnet1d50_deepplus(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_deeperplus[source]

xresnet1d18_deeperplus(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_deeperplus[source]

xresnet1d34_deeperplus(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_deeperplus[source]

xresnet1d50_deeperplus(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')

net = xresnet1d18plus(3, 2, coord=True)
x = torch.rand(32, 3, 50)
net(x)
tensor([[-0.0198,  0.0322],
        [ 0.0740,  0.1516],
        [ 0.0818,  0.0663],
        [ 0.2270, -0.1658],
        [-0.0347,  0.0498],
        [-0.5321,  0.0969],
        [-0.0886,  0.1850],
        [ 0.1142,  0.1375],
        [-0.4652,  0.7560],
        [-0.0749,  0.3875],
        [-0.1290, -0.2009],
        [-0.2658, -0.0194],
        [-0.4039,  0.0762],
        [ 0.0060,  0.5701],
        [-0.1219,  0.6144],
        [-0.0630,  0.2920],
        [-0.2875,  0.3220],
        [ 0.0418,  0.2288],
        [ 0.0716, -0.0458],
        [-0.2295, -0.0607],
        [-0.0861,  0.0701],
        [-0.1200,  0.3971],
        [-0.2329, -0.1175],
        [-0.1352, -0.2607],
        [-0.1228,  0.3307],
        [-0.2759,  0.0553],
        [-0.0906,  0.5389],
        [-0.0633, -0.0666],
        [ 0.0336,  0.5431],
        [ 0.0036, -0.1895],
        [ 0.3577,  0.2622],
        [-0.2278,  0.3647]], grad_fn=<AddmmBackward>)
bs, c_in, seq_len = 2, 4, 32
c_out = 2
x = torch.rand(bs, c_in, seq_len)
archs = [
    xresnet1d18plus, xresnet1d34plus, xresnet1d50plus, 
    xresnet1d18_deepplus, xresnet1d34_deepplus, xresnet1d50_deepplus, xresnet1d18_deeperplus,
    xresnet1d34_deeperplus, xresnet1d50_deeperplus
#     # 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, coord=True)(x).shape, (bs, c_out))
0 xresnet1d18plus
1 xresnet1d34plus
2 xresnet1d50plus
3 xresnet1d18_deepplus
4 xresnet1d34_deepplus
5 xresnet1d50_deepplus
6 xresnet1d18_deeperplus
7 xresnet1d34_deeperplus
8 xresnet1d50_deeperplus
m = xresnet1d34plus(4, 2, act=Mish)
test_eq(len(get_layers(m, is_bn)), 38)
test_eq(check_weight(m, is_bn)[0].sum(), 22)