EfficientNetEncoder¶
- class EfficientNetEncoder(stage_idxs, out_channels, depth=5, channel_multiplier=1.0, depth_multiplier=1.0, drop_rate=0.2, output_stride=32)[source]¶
EfficientNet encoder with configurable scaling parameters.
This class extends EfficientNetBaseEncoder to provide scaling options for depth and channel multipliers, enabling flexible encoder configurations for segmentation and classification tasks.
- Features:
Supports depth and channel scaling.
Provides pretrained weights for multiple variants.
Outputs multi-scale feature maps for downstream tasks.
Example
>>> encoder = EfficientNetEncoder( ... stage_idxs=[2, 3, 5], ... out_channels=[3, 32, 24, 40, 112, 320], ... channel_multiplier=1.0, ... depth_multiplier=1.0, ... drop_rate=0.2 ... ) >>> x = torch.randn(1, 3, 224, 224) >>> features = encoder(x) >>> [f.shape for f in features] ... [torch.Size([1, 3, 224, 224]), torch.Size([1, 32, 112, 112]), ...]
Initialize EfficientNetEncoder.
Creates an EfficientNet encoder with configurable scaling parameters for depth and channel multipliers.
- Parameters:
stage_idxs (list[int]) – Indices of stages for feature extraction.
out_channels (list[int]) – Output channels for each depth level.
depth (int) – Encoder depth (1-5). Defaults to 5.
channel_multiplier (float) – Channel scaling factor. Defaults to 1.0.
depth_multiplier (float) – Depth scaling factor. Defaults to 1.0.
drop_rate (float) – Dropout rate. Defaults to 0.2.
output_stride (int) – Output stride of encoder. Defaults to 32.
Methods
Attributes
training