Large-Small (LS) Convolution module for LSNet. More...


Public Member Functions | |
| __init__ (self, in_channels, out_channels, large_kernel_size=7, small_kernel_size=3, stride=1, padding=None) | |
| Constructor for LSConvolution module. | |
| forward (self, x) | |
| Forward pass through the LS Convolution module. | |
Public Attributes | |
| large_kernel_conv | |
| small_kernel_conv | |
| bn1 | |
| bn2 | |
| relu | |
Large-Small (LS) Convolution module for LSNet.
This module implements the core LS convolution operation that combines large-kernel perception and small-kernel aggregation for efficient feature extraction. Based on the "See Large, Focus Small" strategy from the LSNet paper.
Large-Small (LS) Convolution module as described in the LSNet paper. This module combines large-kernel perception and small-kernel aggregation to efficiently capture a wide range of perceptual information and achieve precise feature aggregation.
| lsnet.LSConvolution.__init__ | ( | self, | |
| in_channels, | |||
| out_channels, | |||
large_kernel_size = 7, |
|||
small_kernel_size = 3, |
|||
stride = 1, |
|||
padding = None |
|||
| ) |
Constructor for LSConvolution module.
| in_channels | Number of input channels |
| out_channels | Number of output channels |
| large_kernel_size | Size of the large kernel for perception |
| small_kernel_size | Size of the small kernel for aggregation |
| stride | Stride of the convolution |
| padding | Padding for the convolution |
Initialize the LS Convolution module.
Args:
in_channels: Number of input channels
out_channels: Number of output channels
large_kernel_size: Size of the large kernel for perception (default: 7)
small_kernel_size: Size of the small kernel for aggregation (default: 3)
stride: Stride of the convolution (default: 1)
padding: Padding for the convolution (default: None, will be calculated)
| lsnet.LSConvolution.forward | ( | self, | |
| x | |||
| ) |
Forward pass through the LS Convolution module.
| x | Input tensor of shape [batch_size, in_channels, height, width] |
Forward pass through the LS Convolution module.
Args:
x: Input tensor of shape [batch_size, in_channels, height, width]
Returns:
Output tensor of shape [batch_size, out_channels, height, width]
| lsnet.LSConvolution.bn1 |
| lsnet.LSConvolution.bn2 |
| lsnet.LSConvolution.large_kernel_conv |
| lsnet.LSConvolution.relu |
| lsnet.LSConvolution.small_kernel_conv |