Resnet from bags of tricks paper
/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "

init_cnn[source]

init_cnn(m)

class XResNet[source]

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

A sequential container. Modules will be added to it in the order they are passed in the constructor. Alternatively, an OrderedDict of modules can be passed in. The forward() method of Sequential accepts any input and forwards it to the first module it contains. It then "chains" outputs to inputs sequentially for each subsequent module, finally returning the output of the last module.

The value a Sequential provides over manually calling a sequence of modules is that it allows treating the whole container as a single module, such that performing a transformation on the Sequential applies to each of the modules it stores (which are each a registered submodule of the Sequential).

What's the difference between a Sequential and a :class:torch.nn.ModuleList? A ModuleList is exactly what it sounds like--a list for storing Module s! On the other hand, the layers in a Sequential are connected in a cascading way.

Example::

# Using Sequential to create a small model. When `model` is run,
# input will first be passed to `Conv2d(1,20,5)`. The output of
# `Conv2d(1,20,5)` will be used as the input to the first
# `ReLU`; the output of the first `ReLU` will become the input
# for `Conv2d(20,64,5)`. Finally, the output of
# `Conv2d(20,64,5)` will be used as input to the second `ReLU`
model = nn.Sequential(
          nn.Conv2d(1,20,5),
          nn.ReLU(),
          nn.Conv2d(20,64,5),
          nn.ReLU()
        )

# Using Sequential with OrderedDict. This is functionally the
# same as the above code
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(n_out=1000, pretrained=False, **kwargs)

xse_resnext18[source]

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

xresnext18[source]

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

xse_resnet34[source]

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

xse_resnext34[source]

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

xresnext34[source]

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

xse_resnet50[source]

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

xse_resnext50[source]

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

xresnext50[source]

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

xse_resnet101[source]

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

xse_resnext101[source]

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

xresnext101[source]

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

xse_resnet152[source]

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

xsenet154[source]

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

xse_resnext18_deep[source]

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

xse_resnext34_deep[source]

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

xse_resnext50_deep[source]

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

xse_resnext18_deeper[source]

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

xse_resnext34_deeper[source]

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

xse_resnext50_deeper[source]

xse_resnext50_deeper(n_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)
tst = xresnet18(ndim=1, c_in=1, ks=15)
x = torch.randn(64, 1, 128)
y = tst(x)
tst = xresnext50(ndim=1, c_in=2, ks=31, stride=4)
x = torch.randn(8, 2, 128)
y = tst(x)
tst = xresnet18(ndim=3, c_in=3, ks=3)
x = torch.randn(8, 3, 32, 32, 32)
y = tst(x)