3.4.9 · D1Convolutional Neural Networks

Foundations — ResNet and skip connections

1,856 words8 min readBack to topic

This page assumes nothing. Every letter, arrow, and word the parent note (3.4.09 ResNet and skip connections (Hinglish) is the Hinglish twin) throws at you is built here from the ground up, in an order where each idea rests on the one before it.


1. What is ? — a picture of a "tensor"

Figure — ResNet and skip connections

Look at the figure: each pastel sheet is one channel, a grid of numbers. The whole stack is one . When the parent note writes " is ", it means exactly this book of 64 pages.

Why the topic needs it: everything ResNet does — convolutions, the skip wire, the addition — operates on these blocks. If you can't picture as a stack of grids, the shape-matching later ( vs ) will feel like magic. It isn't.


2. What is a function , and what is ?

Figure — ResNet and skip connections

In the figure, sits at a starting dot. The desired answer sits at another dot. The straight arrow is the whole journey. The short red arrow is — only the gap between where you already are and where you want to be.

Why the topic needs it: the entire ResNet idea is the equation . Rearranged, that is exactly . Without the word "residual" meaning "the gap", the name Residual Network is empty.


3. The skip connection — the "" wire

Figure — ResNet and skip connections

Trace the figure: enters and splits. One copy goes down through the processing layers (that path produces ). The other copy takes the curved bypass over the top, untouched. At the merge circle they are summed to give . The bypass is the skip connection.

Element-wise addition only works if the two blocks are the same shape. That single requirement is the reason the parent note spends a whole example on "dimension matching" — hold that thought.


4. Symbols inside — weights, ReLU, and the notation

The parent writes . Let's earn every piece.

Figure — ResNet and skip connections

The figure shows ReLU's shape: flat at zero for negative inputs, then a straight line for positives — a bent hinge.


5. Loss , the derivative , and the chain rule

The gradient section of the parent is scary only because of unfamiliar symbols. Here they are, one at a time.

Now the "" miracle reads plainly. With : The skip wire contributes a clean that the shrinking product can never kill. Even if , the sensitivity keeps its and the gradient still reaches the early layers.


6. Two shape-changing symbols: stride and the convolution


Prerequisite map

Tensor x = C x H x W stack of grids

Mapping H of x the ideal output

Residual F of x = H minus x the gap

Skip connection y = F of x + x

Weights W and ReLU inside F of x

Loss L one number of wrongness

Partial derivative sensitivity

Chain rule multiply slopes

Plus 1 gradient highway

Stride and 1x1 conv change shape

Projection shortcut W s

ResNet residual block


Equipment checklist

Cover the right side and answer aloud. If any stumps you, re-read its section above.

What shape does describe?
64 channels, each a grid — a stack of 64 pages.
What does mean in words?
The residual, the gap : how much to change to reach the desired output.
What is the skip connection physically?
A wire carrying an unchanged copy of around the layers, added back at the end.
Why ReLU instead of sigmoid inside the block?
ReLU's slope is 1 for positive inputs, so it does not shrink gradients the way sigmoid does.
What does measure?
How much the loss changes if you nudge — a sensitivity/slope.
State the chain rule in words.
Multiply the slopes along the path from loss to the thing you care about.
Where does the "" gradient term come from?
From , the derivative of the identity skip path.
When do you need a projection ?
When and differ in spatial size or channel count, so plain addition would fail.
What does stride 2 do to a grid?
Halves it to .
What can a conv change and not change?
It changes channel count; it cannot change height or width.