Inception-v4 feature-extracting backbone.
Implements the non-residual network of Szegedy et al., "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning", AAAI 2017 (Figure 9): the multi-branch stem of Figure 3, four Inception-A modules, Reduction-A, seven Inception-B modules, Reduction-B, and three Inception-C modules. Designed for RGB inputs, which it maps to an feature map.
Parameters
configInceptionV4Configinception_v4 for the
paper configuration.Attributes
configInceptionV4Configfeaturesnn.Sequentialfeatures.0–features.5 are the stem,
6–9 Inception-A, 10 Reduction-A, 11–17
Inception-B, 18 Reduction-B and 19–21 Inception-C.feature_infolist[FeatureInfo]Notes
Every module is a filter concatenation of parallel branches,
with no residual shortcut anywhere — that is what separates Inception-v4 from its sibling Inception-ResNet. The trunk holds 41.1 M parameters; the paper reports 20.0% top-1 / 5.0% top-5 single-crop error on the ImageNet validation set for the full classifier.
Examples
>>> import lucid
>>> from lucid.models.vision.inception_v4 import inception_v4
>>> backbone = inception_v4().eval()
>>> x = lucid.randn(1, 3, 299, 299)
>>> backbone.forward_features(x).shape
(1, 1536, 8, 8)
>>> [f.num_channels for f in backbone.feature_info]
[64, 160, 384, 1024, 1536]Used by 2
Constructors
1Properties
1Instance methods
2forward(x: Tensor)Return the trunk's feature map as last_hidden_state.
Parameters
(B, in_channels, H, W).Returns
BaseModelOutputlast_hidden_state of shape (B, 1536, H', W').