GoogLeNet (Inception v1) feature-extracting backbone.
Implements the 22-layer Inception v1 network from Szegedy et al.,
"Going Deeper with Convolutions", CVPR 2015: a five-block stem
(Conv stride-2 → MaxPool → →
→ MaxPool) followed by nine
_InceptionModule blocks grouped into three stages
(Inception 3a-3b → MaxPool → 4a-4e → MaxPool → 5a-5b) and a final
lucid.nn.AdaptiveAvgPool2d to a spatial
map. Every convolution is batch-normalised, matching the canonical
distributed ImageNet checkpoint. The two auxiliary classifiers
attached at Inception 4a and 4d in the original paper are part of
the classifier variant only, not the backbone.
Parameters
configGoogLeNetConfiggooglenet for the
paper-cited configuration; pass a custom config to switch input
channel count. aux_logits is irrelevant for the backbone.Attributes
configGoogLeNetConfigconv1, conv2, conv3_BasicConv2dmaxpool1, maxpool2nn.MaxPool2dinception3a, inception3b_InceptionModuleinception4a … inception4e_InceptionModuleinception5a, inception5b_InceptionModulemaxpool3, maxpool4nn.MaxPool2davgpoolnn.AdaptiveAvgPool2dfeature_ infolist[FeatureInfo]BackboneMixin.Notes
Each _InceptionModule computes four parallel branches in a
single layer:
The bottlenecks before the larger spatial convolutions keep the parameter count manageable: GoogLeNet has only ≈6.8 M parameters compared with ≈60 M for AlexNet, despite being substantially deeper and reaching a top-5 ImageNet validation error of 6.67%. This was the ILSVRC-2014 classification winner.
Examples
Build a GoogLeNet backbone and run a single forward pass:
>>> import lucid
>>> from lucid.models.vision.googlenet import googlenet
>>> backbone = googlenet()
>>> x = lucid.randn(2, 3, 224, 224)
>>> out = backbone(x)
>>> out.last_hidden_state.shape
(2, 1024, 7, 7)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.