DilatedConv2d
Dilated (Atrous) Convolution layer.
Dilated convolution introduces gaps (holes) between the kernel elements, effectively increasing the receptive field without increasing the number of parameters or computational cost. This is particularly useful for semantic segmentation and other tasks where capturing multi-scale context is important.
The dilation parameter controls the spacing between kernel elements:
dilation = (1, 1): standard convolution
dilation = (2, 2): skip every other pixel
dilation = (4, 4): skip every 4th pixel
Dilated convolution is also known as "atrous convolution" (from the French word "à trous" meaning "with holes").
This is essentially a convenience wrapper around Conv2d with explicit dilation handling and additional utility methods for dilated convolution operations.
Parameters
Number of input channels
Number of output channels/filters
Size of the convolving kernel (height, width)
Spacing between kernel elements (dilation rate)
Stride of the convolution (default: 1, 1)
Padding added to all sides of the input (default: 0, 0)
Number of groups for grouped dilated convolution (default: 1)
Whether to add a learnable bias to the output (default: true)
Name of the module
Initial weights tensor
Initial bias tensor (if bias is true)
Types
Functions
Returns information about the dilated convolution configuration.
Returns the effective kernel size considering dilation. This is the size of the receptive field that the dilated kernel covers.
Checks if this is a standard convolution (dilation == (1, 1)).
Returns the total number of parameters in this layer. Dilation doesn't change the parameter count compared to standard convolution.
Returns the receptive field expansion ratio compared to standard convolution. This shows how much larger the receptive field is due to dilation.
Returns the receptive field size at the input level. This shows how much of the input each output pixel can "see".