# XResnet


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L22"
target="_blank" style="float:right; font-size:smaller">source</a>

### init_cnn

``` python
def init_cnn(
    m
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L28"
target="_blank" style="float:right; font-size:smaller">source</a>

### XResNet

``` python
def XResNet(
    block, expansion, layers, p:float=0.0, c_in:int=3, n_out:int=1000, stem_szs:tuple=(32, 32, 64), widen:float=1.0,
    sa:bool=False, act_cls:type=ReLU, ndim:int=2, ks:int=3, stride:int=2, *, groups:int=1, reduction:NoneType=None,
    nh1:NoneType=None, nh2:NoneType=None, dw:bool=False, g2:int=1, sym:bool=False,
    norm_type:fastai.layers.NormType=<NormType.Batch: 1>, pool:function=AvgPool, pool_first:bool=True,
    padding:NoneType=None, bias:NoneType=None, bn_1st:bool=True, transpose:bool=False, init:str='auto',
    xtra:NoneType=None, bias_std:float=0.01, dilation:Union[int, tuple[int, int]]=1,
    padding_mode:Literal['zeros', 'reflect', 'replicate', 'circular']='zeros', device:NoneType=None,
    dtype:NoneType=None
):
```

*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`](https://docs.fast.ai/torch_core.html#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()),
            ]
        )
    )

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L80"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet50_deeper

``` python
def xresnet50_deeper(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L79"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet34_deeper

``` python
def xresnet34_deeper(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L78"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet18_deeper

``` python
def xresnet18_deeper(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L77"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet50_deep

``` python
def xresnet50_deep(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L76"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet34_deep

``` python
def xresnet34_deep(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L75"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet18_deep

``` python
def xresnet18_deep(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L74"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet152

``` python
def xresnet152(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L73"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet101

``` python
def xresnet101(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L72"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet50

``` python
def xresnet50(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L71"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet34

``` python
def xresnet34(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L70"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnet18

``` python
def xresnet18(
    pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L112"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext50_deeper

``` python
def xse_resnext50_deeper(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L111"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext34_deeper

``` python
def xse_resnext34_deeper(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L110"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext18_deeper

``` python
def xse_resnext18_deeper(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L109"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext50_deep

``` python
def xse_resnext50_deep(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L108"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext34_deep

``` python
def xse_resnext34_deep(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L107"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext18_deep

``` python
def xse_resnext18_deep(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L105"
target="_blank" style="float:right; font-size:smaller">source</a>

### xsenet154

``` python
def xsenet154(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L104"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnet152

``` python
def xse_resnet152(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L103"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnext101

``` python
def xresnext101(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L102"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext101

``` python
def xse_resnext101(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L101"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnet101

``` python
def xse_resnet101(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L100"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnext50

``` python
def xresnext50(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L99"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext50

``` python
def xse_resnext50(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L98"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnet50

``` python
def xse_resnet50(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L97"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnext34

``` python
def xresnext34(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L96"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext34

``` python
def xse_resnext34(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L95"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnet34

``` python
def xse_resnet34(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L94"
target="_blank" style="float:right; font-size:smaller">source</a>

### xresnext18

``` python
def xresnext18(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L93"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnext18

``` python
def xse_resnext18(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/models/xresnet.py#L92"
target="_blank" style="float:right; font-size:smaller">source</a>

### xse_resnet18

``` python
def xse_resnet18(
    n_out:int=1000, pretrained:bool=False, **kwargs
):
```

``` python
tst = xse_resnext18()
x = torch.randn(64, 3, 128, 128)
y = tst(x)
```

``` python
tst = xresnext18()
x = torch.randn(64, 3, 128, 128)
y = tst(x)
```

``` python
tst = xse_resnet50()
x = torch.randn(8, 3, 64, 64)
y = tst(x)
```

``` python
tst = xresnet18(ndim=1, c_in=1, ks=15)
x = torch.randn(64, 1, 128)
y = tst(x)
```

``` python
tst = xresnext50(ndim=1, c_in=2, ks=31, stride=4)
x = torch.randn(8, 2, 128)
y = tst(x)
```

``` python
tst = xresnet18(ndim=3, c_in=3, ks=3)
x = torch.randn(8, 3, 32, 32, 32)
y = tst(x)
```
