Skip to content
fn

inception_resnet_v2

→InceptionResNetV2
inception_resnet_v2(pretrained: bool = False, overrides: object = {})

Inception-ResNet v2 feature-extracting backbone.

Builds an InceptionResNetV2 with the paper-cited Szegedy 2017 topology: 5-conv stem → Mixed_5b → 10× Block35 → Reduction-A → 20× Block17 → Reduction-B → 9× Block8 (+ 1 no-ReLU block) → 1×11\times1 projection to 1536 channels. Designed for 299×299299\times299 RGB inputs. Approximately 54.3 M parameters in the backbone alone.

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for inception_resnet_v2, so True raises NotImplementedError rather than return randomly initialised weights. inception_resnet_v2_cls is the checkpointed variant.
**overridesobject= {}
Keyword overrides forwarded into InceptionResNetConfig. Use scale_a / scale_b / scale_c to tune the residual-branch scaling factors (defaults 0.17 / 0.10 / 0.20 from the paper).

Returns

InceptionResNetV2

Backbone with the Inception-ResNet v2 configuration applied (or with overrides merged on top of it).

Notes

See Szegedy et al., "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning", AAAI 2017. Top-5 ImageNet validation error of 3.08% (full classifier). No paper-cited size variants (H11) — only v2 is implemented here; v1 differs primarily in widths.

Examples

>>> import lucid
>>> from lucid.models.vision.inception_resnet import inception_resnet_v2
>>> model = inception_resnet_v2()
>>> x = lucid.randn(1, 3, 299, 299)
>>> out = model(x)
>>> out.last_hidden_state.shape   # (B, 1536, 1, 1)
(1, 1536, 8, 8)

Used by 1