InceptionResNetV2
PretrainedModelBackboneMixinInceptionResNetV2(config: InceptionResNetConfig)Inception-ResNet v2 feature-extracting backbone.
Implements the residual-Inception topology from Szegedy et al.,
"Inception-v4, Inception-ResNet and the Impact of Residual
Connections on Learning", AAAI 2017. The body consists of three
residual Inception block families — _Block35 (×10),
_Block17 (×20), and _Block8 (×9 + 1 no-ReLU
block) — separated by Reduction-A (_Mixed6a) and
Reduction-B (_Mixed7a) blocks, with a leading Mixed_5b
pre-block (_Mixed5b) and a final
projection (conv2d_7b) to 1536 channels. Designed for
RGB inputs. State-dict naming matches the
canonical timm / TensorFlow-Slim implementation so weight transfer
is straightforward.
Parameters
configInceptionResNetConfiginception_resnet_v2 for
the paper-cited configuration with the recommended residual
scale factors (0.17 / 0.10 / 0.20).Attributes
configInceptionResNetConfigconv2d_1a, conv2d_2a, conv2d_2b, conv2d_3b, conv2d_4ann.Modulemixed_5b_Mixed5brepeatnn.Sequential_Block35 residual Inception-A blocks.mixed_6a_Mixed6arepeat_1nn.Sequential_Block17 residual Inception-B blocks.mixed_7a_Mixed7arepeat_2nn.Sequential_Block8 residual Inception-C blocks.block8_Block8conv2d_7b_ConvBnReLUavgpoolnn.AdaptiveAvgPool2dfeature_infolist[FeatureInfo]BackboneMixin.Notes
Each residual Inception block computes
with a small fixed scale factor (0.10–0.20). The residual-scale trick was introduced specifically for Inception-ResNet because unscaled residuals caused training to diverge on networks with many filters per Inception module. Approximately 55.8 M parameters; achieves a top-5 ImageNet validation error of 3.08% in the original paper.
Examples
>>> import lucid
>>> from lucid.models.vision.inception_resnet import inception_resnet_v2
>>> backbone = inception_resnet_v2()
>>> x = lucid.randn(1, 3, 299, 299)
>>> out = backbone(x)
>>> out.last_hidden_state.shape # (B, 1536, 1, 1)
(1, 1536, 1, 1)