InceptionNeXt
PretrainedModelBackboneMixinInceptionNeXt(config: InceptionNeXtConfig)InceptionNeXt backbone (Yu et al., 2024).
A drop-in replacement for the ConvNeXt backbone that factorizes the single large depthwise conv into four parallel Inception-style branches operating on disjoint channel splits:
with (default 11). The four branches together preserve a large effective receptive field while cutting depthwise FLOPs and memory traffic relative to a single depthwise conv. Each MetaNeXtBlock further applies BatchNorm, a 1x1 Conv-MLP, and a layer-scale parameter on the residual branch.
forward_features returns the global-average-pooled
feature.
Parameters
configInceptionNeXtConfigdepths, dims,
band_kernel, mlp_ratios, in_channels, and
num_classes. See InceptionNeXtConfig.Attributes
stemnn.Sequentialstagesnn.ModuleList_Stage modules, each containing an optional
downsampler and a sequence of MetaNeXt blocks.feature_ infolist[FeatureInfo]Notes
Reference: Weihao Yu et al., "InceptionNeXt: When Inception Meets ConvNeXt", CVPR 2024, arXiv:2303.16900.
Examples
Build an InceptionNeXt-T backbone and run a forward pass:
>>> import lucid
>>> from lucid.models.vision.inception_next import (
... InceptionNeXt, InceptionNeXtConfig,
... )
>>> model = InceptionNeXt(InceptionNeXtConfig())
>>> x = lucid.randn(1, 3, 224, 224)
>>> feat = model.forward_features(x)
>>> feat.shape # (B, dims[-1])
(1, 768)Used by 2
Constructors
1Instance methods
2forward(x: Tensor)Override in subclasses to define the computation.
Run the backbone's feature-extraction pass.
Parameters
(B, C, H, W).Returns
TensorFeature map at the deepest stage. Concrete subclasses may additionally stash earlier stages on the instance so multi-stage consumers can fetch them.
Examples
The map returned is the one feature_info lists last, so a
neck can size itself from that entry without running the model.
>>> import lucid
>>> from lucid.models import create_model
>>> backbone = create_model("resnet_18").eval()
>>> last = backbone.feature_info[-1]
>>> last.num_channels, last.reduction
(512, 32)
>>> backbone.forward_features(lucid.randn((1, 3, 64, 96))).shape
(1, 512, 2, 3)
Each side is divided by the advertised reduction on its own, so
a non-square input keeps its aspect ratio.