Skip to content
data

InceptionV3Output

extendsImageClassificationOutput
InceptionV3Output(logits: Tensor, loss: Tensor | None = None, hidden_states: tuple[Tensor, ...] | None = None, attentions: tuple[Tensor, ...] | None = None, aux_logits: Tensor | None = None)

Structured forward output for InceptionV3ForImageClassification.

Carries the main classifier logits and the optional auxiliary classifier logits emitted during training only. The auxiliary head in Inception v3 attaches after the last 17x17 stage (inception_c3 / Mixed_6e in the paper diagram) and is only active when both config.aux_logits=True and the model is in training mode.

Parameters

logitsTensor
Main classifier output of shape (B, num_classes).
lossTensor or None= None
Cross-entropy loss with auxiliary term (weight 0.4, a reference training constant rather than a paper figure) when labels were passed to forward; None otherwise.
aux_logitsTensor or None= None
Logits from the auxiliary classifier of shape (B, num_classes); None at inference or when aux_logits=False.

Notes

From Szegedy et al., "Rethinking the Inception Architecture for Computer Vision", CVPR 2016, §6. Training loss with the auxiliary head is

L=Lmain+0.4⋅Laux.\mathcal{L} = \mathcal{L}_{\text{main}} + 0.4 \cdot \mathcal{L}_{\text{aux}}.

Examples

>>> import lucid
>>> from lucid.models.vision.inception import inception_v3_cls
>>> model = inception_v3_cls(aux_logits=True).eval()
>>> x = lucid.randn(1, 3, 299, 299)
>>> out = model(x)
>>> out.aux_logits is None   # inactive at eval
True

Used by 1