Skip to content
data

XceptionOutput

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

Forward-return dataclass for XceptionForImageClassification.

Carries the per-class logits and the optional supervised loss computed when training labels are supplied to forward.

Attributes

logitsTensor
Pre-softmax classification scores of shape (batch_size, num_classes). Apply lucid.softmax or lucid.argmax to convert to probabilities or hard predictions.
lossTensor or None, optional, default=None
Scalar cross-entropy loss; present only when labels were passed to the forward call. None during inference.

Notes

Returned by XceptionForImageClassification.forward so the public API stays decoupled from raw tensor tuples — callers can address fields by name (out.logits) and ignore irrelevant entries.

Examples

>>> import lucid
>>> from lucid.models.vision.xception import xception_cls
>>> model = xception_cls()
>>> x = lucid.randn(2, 3, 299, 299)
>>> out = model(x)
>>> out.logits.shape
(2, 1000)
>>> out.loss is None
True

Used by 1