01Chapter 1: Embeddings: representing images and text as vectorsAn embedding is a fixed-length list of numbers (a vector) that a model produces for an input such as an image, a sentence, or a word. Inputs that the model treats as similar get vectors that lie near each other. This chapter covers what embeddings are, how images and text each get turned into them, 6 min read
02Chapter 2: Cosine similarity and why embeddings are normalizedThis chapter assumes you know Python and PyTorch tensor operations, the dot product, and the vector norm. It also assumes you know what an embedding is from the previous chapter. By the end you should be able to compute cosine similarity by hand, explain why CLIP normalizes its embeddings, and avoid6 min read
03Chapter 3: The idea of a joint image-text embedding spaceThis chapter assumes you know basic PyTorch tensor operations, what an embedding is, and how the dot product and vector norm work. It also assumes you understand softmax and cross-entropy at a high level. It covers one idea: why one vector space can hold both images and text, and what that space let7 min read
04Chapter 4: CLIP's dual-encoder architectureThis chapter assumes you know PyTorch tensors, what an embedding and cosine similarity are, and roughly how a Transformer or a CNN turns an input into a feature vector. By the end you should be able to sketch CLIP's architecture, say what shapes flow through it, and explain why the design makes retr4 min read
05Chapter 5: The image encoder: ResNet and Vision Transformer variantsThis chapter assumes you know what a convolution is, how a Transformer block uses self-attention, and what an embedding vector is. It also assumes you can read PyTorch tensor shapes. The earlier chapters covered the dual-encoder layout. Here we look inside the image half of that layout.5 min read
06Chapter 6: The text encoder: a Transformer over captionsThis chapter covers the text half of CLIP's dual encoder. It assumes you know basic PyTorch, how self-attention and softmax work at a high level, and what an embedding is. By the end you should be able to explain how a caption becomes one vector in the joint space, and you should be able to spot the7 min read
07Chapter 7: Training data: image-text pairs from the webThis chapter assumes you know what an embedding is, how cosine similarity works, and how a contrastive batch is built. You should also be comfortable reading short PyTorch snippets. Here we look at the data CLIP learns from. The data shapes what the model can and cannot do, so it matters as much as 6 min read
08Chapter 8: Contrastive learning and in-batch negativesThis chapter assumes you know what a dual encoder is, that embeddings are L2-normalized vectors, and that cross-entropy over softmax logits trains a classifier. The next chapter derives the symmetric loss step by step. This chapter covers the idea behind it: what a contrastive objective asks of the 5 min read
09Chapter 9: The symmetric contrastive loss, step by stepThis chapter assumes you know softmax and cross-entropy, can read PyTorch tensor code, and understand cosine similarity and normalized embeddings from earlier chapters. It builds CLIP's training loss from those pieces and then implements it.4 min read
10Chapter 10: The learned temperature (logit scale)This chapter assumes you know the dot product, vector norms, softmax, and cross-entropy loss, and that you have read the chapters on cosine similarity and the symmetric contrastive loss. Here we look at one scalar inside the CLIP loss, the temperature, and why it matters.6 min read
11Chapter 11: Zero-shot classification with text promptsThis chapter assumes you know what a joint image-text embedding space is, how CLIP's two encoders produce normalized vectors, and how cosine similarity and softmax work. You should be comfortable with basic PyTorch tensor operations. Here you will turn a trained CLIP model into an image classifier w5 min read
12Chapter 12: Prompt templates and prompt ensemblingThis chapter assumes you have read the zero-shot classification chapter. You should know that a CLIP classifier is built by embedding class names as text and comparing them to an image embedding by cosine similarity. You should also be comfortable with PyTorch tensors and L2 normalization.5 min read
13Chapter 13: Image-text retrieval and semantic searchThis chapter assumes you know how CLIP produces normalized image and text embeddings, what cosine similarity measures, and basic PyTorch tensor operations. It builds on those ideas to show how retrieval works: you rank items by similarity in the joint embedding space. It also covers how to scale the5 min read
14Chapter 14: Linear probes and evaluating learned featuresThis chapter assumes you know how CLIP's image encoder produces a normalized embedding, and that you are comfortable with PyTorch tensors, softmax, cross-entropy, and train/validation/test splits. You do not need to have trained a CLIP model yourself.6 min read
15Chapter 15: Limitations, biases, and failure modesThis chapter assumes you know how CLIP's dual encoder, symmetric contrastive loss, and zero-shot classification work, and that you can read basic PyTorch. CLIP is strong on broad recognition and retrieval, but it fails in predictable ways. Most failures trace back to three things: the training objec5 min read
16Chapter 16: Successors and variants: OpenCLIP, ALIGN, SigLIPThis chapter assumes you know the CLIP dual-encoder design, the symmetric softmax contrastive loss, and the learned temperature from earlier chapters. You should also be comfortable with PyTorch tensors and with sigmoid versus softmax. The chapter covers what later models changed (data, encoders5 min read
17Chapter 17: Using CLIP embeddings in other systemsThis chapter covers how to take CLIP out of the notebook and use its embeddings as a component in search, filtering, classification, and generation systems. It assumes you can already compute image and text embeddings with a pretrained CLIP model (earlier chapters), that you know cosine similarity a5 min read