Skip to content
BIASED

Vision Transformers

Block 1 of 7~2 min

From MAE to a sequence of patches

The masked autoencoder of Self-supervised learning needed an encoder that sees an image as a set of patches and can drop most of them. That encoder is the Vision Transformer (ViT): cut the image into patches, turn each into a vector, and process the sequence with the Transformer encoder that the NLP course builds for text. Almost nothing in it is specific to images — strength and weakness at once.

A convolutional network builds assumptions into every layer: locality, weight sharing, translation equivariance (see Convolution). Those are an inductive bias: they restrict the functions the network can learn to ones plausible for images, so a CNN learns from few examples. The price is slow travel of information — distant pixels interact only after depth grows the receptive field. Self-attention makes the opposite choice: every token attends to every other in one layer, with weights from content. Nothing tells the layer that neighbours are related; it must learn that from data.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • ViT: patch embedding dimensionsoptional

    Count patches, CLS token, and projection parameters for ViT-B/16. Self-check in the notebook.

    ~15 min · easier on a computer · Vision Transformers topic read.

    Self-check in the notebook — not part of mastery or the certificate.