inception_v3_cls(pretrained: bool | str = False, weights: InceptionV3Weights | None = None, overrides: object = {})Inception v3 image classifier (no auxiliary head by default).
Builds an InceptionV3ForImageClassification with the
paper-cited Szegedy 2016 topology. Default configuration matches
the standard reference-framework setting of aux_logits=False —
approximately 23.8 M parameters; enable the auxiliary classifier
by passing aux_logits=True (adds ≈4 M parameters used only
during training). Designed for RGB inputs;
achieves a top-5 ImageNet validation error of 3.5%.
Model Size
Parameters
pretrainedbool or str= FalseFalse → random init; True
→ the DEFAULT tag (InceptionV3Weights.IMAGENET1K_V1);
a tag string (e.g. "IMAGENET1K_V1") → that specific
checkpoint. Mutually exclusive with weights (which wins if
both are given).InceptionV3Weights.IMAGENET1K_V1. Takes precedence over
pretrained.**overridesobject= {}InceptionConfig.
Common picks: num_classes=N to retarget the head,
aux_logits=True to enable the auxiliary classifier,
dropout=p to adjust regularisation strength. Note:
overriding num_classes (or aux_logits) away from the
checkpoint topology makes pretrained loading fail the strict
key/shape check.Returns
InceptionV3ForImageClassificationClassifier with the Inception v3 configuration applied (or with
overrides merged on top of it), optionally initialised from
pretrained weights.
Notes
See Szegedy et al., "Rethinking the Inception Architecture for Computer Vision", CVPR 2016, §6. Training with the auxiliary head adds a 0.4-weighted cross-entropy term as
Pretrained weights are converted from torchvision's
Inception_V3_Weights (auxiliary head dropped) and hosted on the
Hugging Face Hub under lucid-dl/inception-v3. They evaluate at a
299-pixel centre crop resized from 342.
Examples
>>> import lucid
>>> from lucid.models.vision.inception import inception_v3_cls
>>> model = inception_v3_cls().eval()
>>> x = lucid.randn(2, 3, 299, 299)
>>> out = model(x)
>>> out.logits.shape
(2, 1000)
Load ImageNet-pretrained weights:
>>> model = inception_v3_cls(pretrained=True) # DEFAULT tag
>>> from lucid.models.vision.inception import InceptionV3Weights
>>> model = inception_v3_cls(weights=InceptionV3Weights.IMAGENET1K_V1)