Resnet from bags of tricks paper
from nbdev.showdoc import *

init_cnn[source]

init_cnn(m)

class XResNet[source]

XResNet(block, expansion, layers, p=0.0, c_in=3, c_out=1000, stem_szs=(32, 32, 64), widen=1.0, sa=False, act_cls='ReLU', stride=1, groups=1, reduction=None, nh1=None, nh2=None, dw=False, g2=1, sym=False, norm_type=NormType.Batch, 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) :: 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())
        ]))

xresnet18[source]

xresnet18(pretrained=False, **kwargs)

xresnet34[source]

xresnet34(pretrained=False, **kwargs)

xresnet50[source]

xresnet50(pretrained=False, **kwargs)

xresnet101[source]

xresnet101(pretrained=False, **kwargs)

xresnet152[source]

xresnet152(pretrained=False, **kwargs)

xresnet18_deep[source]

xresnet18_deep(pretrained=False, **kwargs)

xresnet34_deep[source]

xresnet34_deep(pretrained=False, **kwargs)

xresnet50_deep[source]

xresnet50_deep(pretrained=False, **kwargs)

xresnet18_deeper[source]

xresnet18_deeper(pretrained=False, **kwargs)

xresnet34_deeper[source]

xresnet34_deeper(pretrained=False, **kwargs)

xresnet50_deeper[source]

xresnet50_deeper(pretrained=False, **kwargs)

xse_resnet18[source]

xse_resnet18(c_out=1000, pretrained=False, **kwargs)

xse_resnext18[source]

xse_resnext18(c_out=1000, pretrained=False, **kwargs)

xresnext18[source]

xresnext18(c_out=1000, pretrained=False, **kwargs)

xse_resnet34[source]

xse_resnet34(c_out=1000, pretrained=False, **kwargs)

xse_resnext34[source]

xse_resnext34(c_out=1000, pretrained=False, **kwargs)

xresnext34[source]

xresnext34(c_out=1000, pretrained=False, **kwargs)

xse_resnet50[source]

xse_resnet50(c_out=1000, pretrained=False, **kwargs)

xse_resnext50[source]

xse_resnext50(c_out=1000, pretrained=False, **kwargs)

xresnext50[source]

xresnext50(c_out=1000, pretrained=False, **kwargs)

xse_resnet101[source]

xse_resnet101(c_out=1000, pretrained=False, **kwargs)

xse_resnext101[source]

xse_resnext101(c_out=1000, pretrained=False, **kwargs)

xresnext101[source]

xresnext101(c_out=1000, pretrained=False, **kwargs)

xse_resnet152[source]

xse_resnet152(c_out=1000, pretrained=False, **kwargs)

xsenet154[source]

xsenet154(c_out=1000, pretrained=False, **kwargs)

xse_resnext18_deep[source]

xse_resnext18_deep(c_out=1000, pretrained=False, **kwargs)

xse_resnext34_deep[source]

xse_resnext34_deep(c_out=1000, pretrained=False, **kwargs)

xse_resnext50_deep[source]

xse_resnext50_deep(c_out=1000, pretrained=False, **kwargs)

xse_resnext18_deeper[source]

xse_resnext18_deeper(c_out=1000, pretrained=False, **kwargs)

xse_resnext34_deeper[source]

xse_resnext34_deeper(c_out=1000, pretrained=False, **kwargs)

xse_resnext50_deeper[source]

xse_resnext50_deeper(c_out=1000, pretrained=False, **kwargs)

tst = xse_resnext18()
x = torch.randn(64, 3, 128, 128)
y = tst(x)
tst = xresnext18()
x = torch.randn(64, 3, 128, 128)
y = tst(x)
tst = xse_resnet50()
x = torch.randn(8, 3, 64, 64)
y = tst(x)