core/nn/vision/vit_classifier library

Image classifier on top of a Vision Transformer backbone.

Wraps a ViTBackbone and a Linear(embedDim, numClasses) head that reads the CLS token of the encoded sequence and produces class logits [1, numClasses]. Combine with `crossEntropy` on a target class index tensor [1] for training.

This is the simplest ViT head — good for CIFAR-style classification and as a sanity test of the backbone. For dense-prediction tasks (object detection, segmentation), replace this head with something per-patch or add learnable query tokens.

Classes

ViTClassifier