Convolutional Networks
Networks that slide one small learned filter across an image, so the same pattern detector is reused at every position.
Needs a step first: 48
A convolutional layer applies a small kernel, say , at every position of an image and records how strongly each patch matches it. Because the same weights are shared everywhere, the layer needs few parameters and detects a feature wherever it appears. Early layers learn edges and textures, deeper ones combine them into parts and objects, and pooling or strides shrink the image as features grow. Convolution is the operation from Fourier analysis, which explains why it acts as a filter; image generators, including diffusion models, still use it.
Where it shows up: Convolutional networks are the backbone of most image models, including the denoising networks inside diffusion models.
How to hold it: In your head
See a convolutional layer as one small pattern detector slid across the image, so a few weights find the same feature wherever it appears.
What knowing it looks like
- Compute a small 2D convolution (as cross-correlation, the deep-learning convention) by hand.
- Count a convolutional layer's parameters and its output size from kernel size, channels, stride and padding.
- Explain why weight sharing makes a detector work at every position.
Test yourself
Slide the kernel over the image (stride 1, no padding, no flipping) and give the output. Then: how many parameters does a layer with kernels, 3 input channels and 16 output channels have, counting one bias per output channel?
Show the worked answer
Needs a step first: 48
Learn it with an AI
Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.
Be my maths tutor. I'm learning "Convolutional Networks" (Frontier tier): Networks that slide one small learned filter across an image, so the same pattern detector is reused at every position.
I already know: Training Deep Networks, The Fourier Transform.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: Slide the kernel $K = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$ over the image $I = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 2 & 1 & 0 \end{pmatrix}$ (stride 1, no padding, no flipping) and give the output. Then: how many parameters does a layer with $3\times3$ kernels, 3 input channels and 16 output channels have, counting one bias per output channel?
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.Needs first
- Training Deep NetworksThe practical craft that makes deep networks learn: sensible initialisation, normalisation, learning-rate schedules, minibatches and watching validation loss.Frontier · Machine Learning
- The Fourier TransformThe Fourier series for functions that never repeat: any signal becomes a continuous spread of frequencies.Undergraduate II · Differential Equations & Fourier
Leads to
This is the end of a path.
Recommended
- Neural Networks: Zero to HeroAndrej Karpathy · VideosFree lectures that build backpropagation, a language model and a small GPT from scratch in Python, explaining every line.
- Understanding Deep LearningSimon J. D. Prince (MIT Press) · BookA clear, well-illustrated 2023 textbook covering networks, training, transformers, diffusion models and reinforcement learning, free as a PDF with Python notebooks.
- 动手学深度学习阿斯顿·张、李沐等 · Book · 中文The Chinese edition of Dive into Deep Learning: a free textbook in which every model, from linear regression to transformers, runs as code beside the maths.
- 跟李沐学AI李沐 · Videos · 中文Mu Li's own Bilibili channel: the video course for Dive into Deep Learning and paragraph-by-paragraph readings of key papers, including the Transformer paper.