LESSON 25.02 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Vision Transformers
Watch an 8 × 8 image become patch tokens and one image embedding.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 25.02 · VIT BAY8×8 IMAGE · 4 PATCHES OF 4×4
01
Stage 1 of 6 · Cut into patches
The 8 × 8 image splits into 4 patches of 4 × 4 pixels. Each patch becomes one token.
Explain it simply
A transformer compares every token with every other token. If each of these 64 pixels were a token, that would be 64 times 64, or 4,096 comparisons. So the Vision Transformer cuts it into 4 by 4 squares: 4 tokens instead of 64. A real 224 pixel photo cut into 16 pixel patches gives 196 tokens.
An 8 by 8 image of a 7. A grid splits it into 4 patches of 4 by 4 pixels, numbered row by row.
The class token and the attention weights are random, not trained.
pixels and tokensstencils, patch grid, positionsattention and embeddingnegative value
Toy: an 8 × 8 image of a 7, 4 numbers per token
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The patch count is the pixel count over the patch area.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.