3.4.2 · D5Convolutional Neural Networks
Question bank — Stride, padding, and dilation
Quick symbol reminder so nothing here is unearned:
- = input width in pixels · = kernel width (side length) · = stride (pixels moved per step) · = padding (border pixels added each side) · = dilation rate (spacing between kernel taps) · = effective kernel span .
- Master formula: .
True or false — justify
Doubling the stride roughly halves the output width.
True — the numerator's slack is divided by , so twice the stride visits about half as many positions; it is a downsampling operation like Pooling Layers but learnable.
Doubling the stride doubles the number of parameters.
False — stride only changes where the same kernel lands, never the kernel itself; parameter count is fixed at (times channels).
Doubling the dilation rate changes the number of parameters.
False — dilation spreads the same weights over a wider span by inserting gaps; that is exactly why it is used to grow the receptive field cheaply.
Same-padding with always yields an integer for a kernel.
False — ; even kernels give non-integer, so you must pad asymmetrically (e.g. 1 left, 2 right).
"Same padding" keeps the output the same size regardless of stride.
False — the "same size" guarantee only holds at ; with even same-padding downsamples the output.
A stride-2 convolution and a stride-1 conv followed by 2×2 pooling produce identical results.
False — both downsample by ~2×, but strided conv learns which features to keep while pooling applies a fixed rule (max/avg); they are strategically different.
Valid padding () means the output is always smaller than the input.
True for — with no border added the kernel cannot start where its footprint would fall off the edge, so positions are lost.
Increasing dilation reduces the number of output positions.
False — dilation leaves output count nearly unchanged; it widens what each single position sees, not how many positions exist.
The floor function in the output formula can throw away input pixels.
True — if the slack does not divide evenly by , the last partial step is discarded, so some right/bottom pixels are never a kernel center.
A kernel with has the same receptive field as a dense kernel.
Partly — both span , but the dilated one only samples 9 of those 25 pixels, leaving gaps a dense would cover.
Spot the error
", done."
Missing the — you must count the starting position (position 0) as well as the jumps from it, so the correct form ends in .
"For dilation, just replace with in the formula."
Wrong span — the effective size is , not ; the gaps only sit between the taps, so there are gaps of pixels each, not copies of .
"Padding of 2 on a same-conv preserves size."
Over-padded — same padding needs ; using would make the output larger than the input, not the same.
"Stride 2 means I skip every 2nd output, so I keep positions 0, 2, 4 of the output."
Confusing input and output — stride subsamples the input placements; the output is dense and indexed 0,1,2,..., it is the input centers 0,2,4,... that are spaced.
"With and any , output = input, so no padding is ever needed."
False premise — at and the output shrinks by ; you need to actually preserve size.
"Dilation is fine for segmentation because it covers more area."
Incomplete — a single dilation rate leaves a checkerboard of unseen pixels; Semantic Segmentation Architectures stack multiple dilation rates to fill those gaps for dense prediction.
"To double the receptive field, I must double network depth."
Not the only way — dilation grows the receptive field within a single layer, trading depth for wider sampling without extra parameters.
Why questions
Why does the output formula divide slack by rather than subtract ?
Because stride is a repeated step: the number of steps that fit in the slack is a division (), just like fitting fence posts along a length.
Why is added instead of counting only the jumps?
The first kernel placement at position 0 exists before any jump; jumps count the transitions, and there is always one more position than transitions.
Why does padding make edge pixels "fairer"?
Without padding a corner pixel is inside the kernel's footprint only once; the zero border lets the kernel center sit at the edge, so border pixels get covered times like interior ones.
Why choose odd kernel sizes for same-padding?
Odd makes an integer, giving a symmetric border and a well-defined single center pixel — even kernels force lopsided padding.
Why does dilation grow receptive field "for free" while a bigger kernel does not?
Dilation reuses the same weights spread over a larger span, so parameters stay ; a bigger dense kernel needs new weights to cover the same span.
Why use stride instead of pooling to downsample?
Strided convolution folds downsampling into a learnable, single operation (saving a layer and compute), whereas pooling is a fixed, non-learnable reduction.
Why does the master formula use instead of ?
Because the kernel's physical footprint — not its tap count — determines how far it must fit inside the padded input; dilation inflates that footprint to .
Edge cases
What is the output when exactly?
Slack is 0, so — exactly one placement, the kernel fills the whole padded input.
What if ?
The kernel is larger than the padded input; slack is negative, the formula gives , meaning no valid placement — the layer is ill-defined and must be rejected.
What does mean?
No gaps inserted; , so dilation-1 is ordinary convolution — the identity case of dilation.
What does collapse the formula to?
, the classic valid-convolution shrink, confirming the general formula contains the basic case.
Does a kernel care about stride, padding, or dilation?
Dilation is irrelevant ( gaps), padding rarely needed, but stride still subsamples positions — a strided conv is a pure channel-mixing downsampler.
What happens to output size if you pad but keep ?
Padding increases output: , since a single-pixel kernel can now center on the added border pixels too.
Recall Self-check before you move on
The counts the ::: starting kernel position, not the jumps. Dilation changes parameter count by ::: nothing — it keeps weights. Same-padding preserves size only when ::: the stride is 1. equals ::: .