data
GoogLeNetOutput
GoogLeNetOutput(logits: Tensor, aux_logits1: Tensor | None = None, aux_logits2: Tensor | None = None, loss: Tensor | None = None)Structured forward output for GoogLeNetForImageClassification.
Carries the main classifier logits plus the optional auxiliary
classifier logits emitted during training. Auxiliary heads attach
at Inception 4a and 4d in the original paper and are evaluated
only in training mode when config.aux_logits=True; at
inference both auxiliary fields are None.
Parameters
logitsTensorMain classifier output of shape
(B, num_classes).Logits from the first auxiliary classifier (attached at
Inception 4a) of shape
(B, num_classes); None at
inference or when aux_logits=False.Logits from the second auxiliary classifier (attached at
Inception 4d) of shape
(B, num_classes); None at
inference or when aux_logits=False.Cross-entropy loss including auxiliary terms when labels were
passed to
GoogLeNetForImageClassification.forward;
None otherwise.Notes
From Szegedy et al., "Going Deeper with Convolutions", CVPR 2015, §5. When auxiliary heads are active the training loss combines the main and auxiliary cross-entropies as
a weighting taken directly from the paper that compensates for the auxiliary heads' shallower position in the network.
Examples
>>> import lucid
>>> from lucid.models.vision.googlenet import googlenet_cls
>>> model = googlenet_cls().eval()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.logits.shape
(1, 1000)
>>> out.aux_logits1 is None
True