residual#
- deeplay.blocks.conv.conv2d.residual(block: ~deeplay.blocks.conv.conv2d.Conv2dBlock, order: str = 'lanlan|', activation: ~typing.Type[~torch.nn.modules.module.Module] | ~deeplay.external.layer.Layer = <class 'torch.nn.modules.activation.ReLU'>, normalization: ~typing.Type[~torch.nn.modules.module.Module] | ~deeplay.external.layer.Layer = <class 'torch.nn.modules.batchnorm.BatchNorm2d'>, dropout: float = 0.1)#
Make a residual block with the given order of layers.
Parameters#
- orderstr
The order of layers in the residual block. The shorthand is a string of ‘l’, ‘a’, ‘n’, ‘d’ and ‘|’. ‘l’ stands for layer, ‘a’ stands for activation, ‘n’ stands for normalization, ‘d’ stands for dropout, and ‘|’ stands for the skip connection. The order of the characters in the string determines the order of the layers in the residual block. The characters after the ‘|’ determine the order of the layers after the skip connection.
- activationUnion[Type[nn.Module], Layer]
The activation function to use in the residual block.
- normalizationUnion[Type[nn.Module], Layer]
The normalization layer to use in the residual block.
- dropoutfloat
The dropout rate to use in the residual block.