Skip to content
class

CrossViTForImageClassification

extendsImageClassificationModelClassificationHeadMixin
CrossViTForImageClassification(config: CrossViTConfig)

CrossViT with two per-branch linear heads, output averaged.

Paper §3.3 — the final prediction is the mean of the two branch-specific logits, an implicit two-model ensemble.

Examples

>>> import lucid
>>> from lucid.models.vision.crossvit import (
...     CrossViTForImageClassification,
...     CrossViTConfig,
... )
>>> model = CrossViTForImageClassification(CrossViTConfig()).eval()
>>> out = model(lucid.randn(1, 3, 240, 240))
>>> out.logits.shape
(1, 1000)
>>> out.loss is None
True

Used by 2

Constructors

1
dunder

__init__

→None
__init__(config: CrossViTConfig)

Instance methods

1