XResnet

Open In Colab

Resnet from bags of tricks paper

  1. /usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  2. return torch._C._cuda_getDeviceCount() > 0

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') :: 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::

  1. # Example of using Sequential
  2. model = nn.Sequential(
  3. nn.Conv2d(1,20,5),
  4. nn.ReLU(),
  5. nn.Conv2d(20,64,5),
  6. nn.ReLU()
  7. )
  8. # Example of using Sequential with OrderedDict
  9. model = nn.Sequential(OrderedDict([
  10. ('conv1', nn.Conv2d(1,20,5)),
  11. ('relu1', nn.ReLU()),
  12. ('conv2', nn.Conv2d(20,64,5)),
  13. ('relu2', nn.ReLU())
  14. ]))

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)

  1. tst = xse_resnext18()
  2. x = torch.randn(64, 3, 128, 128)
  3. y = tst(x)
  1. tst = xresnext18()
  2. x = torch.randn(64, 3, 128, 128)
  3. y = tst(x)
  1. tst = xse_resnet50()
  2. x = torch.randn(8, 3, 64, 64)
  3. y = tst(x)
  1. tst = xresnet18(ndim=1, c_in=1, ks=15)
  2. x = torch.randn(64, 1, 128)
  3. y = tst(x)
  1. tst = xresnext50(ndim=1, c_in=2, ks=31, stride=4)
  2. x = torch.randn(8, 2, 128)
  3. y = tst(x)
  1. tst = xresnet18(ndim=3, c_in=3, ks=3)
  2. x = torch.randn(8, 3, 32, 32, 32)
  3. y = tst(x)

Company logo

©2021 fast.ai. All rights reserved.
Site last generated: Mar 31, 2021