DAPPER (Document Analysis, Processing, and Pattern Extraction Repository)
Statistical Learning Final Project for Document Classification
 
Loading...
Searching...
No Matches
lsnet.LSConvolution Class Reference

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

Inheritance diagram for lsnet.LSConvolution:
Inheritance graph
Collaboration diagram for lsnet.LSConvolution:
Collaboration graph

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

lsnet.LSConvolution.__init__ (   self,
  in_channels,
  out_channels,
  large_kernel_size = 7,
  small_kernel_size = 3,
  stride = 1,
  padding = None 
)

Constructor for LSConvolution module.

Parameters
in_channelsNumber of input channels
out_channelsNumber of output channels
large_kernel_sizeSize of the large kernel for perception
small_kernel_sizeSize of the small kernel for aggregation
strideStride of the convolution
paddingPadding 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)

Member Function Documentation

◆ forward()

lsnet.LSConvolution.forward (   self,
  x 
)

Forward pass through the LS Convolution module.

Parameters
xInput tensor of shape [batch_size, in_channels, height, width]
Returns
Output tensor of shape [batch_size, out_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]

Member Data Documentation

◆ bn1

lsnet.LSConvolution.bn1

◆ bn2

lsnet.LSConvolution.bn2

◆ large_kernel_conv

lsnet.LSConvolution.large_kernel_conv

◆ relu

lsnet.LSConvolution.relu

◆ small_kernel_conv

lsnet.LSConvolution.small_kernel_conv

The documentation for this class was generated from the following file: