179 questions
No questions match those filters.
Debugging backprop through a CNN with max pooling, you...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansVanishing gradients and this look similar on a dashboard — weights not updating — but the mechanism is completely different, and confusing the two leads to the wrong fix. Vanishing gradients come from gradient magnitude decaying multiplicatively through many layers of backpropagation. What’s happening at a max pooling layer is not decay, it’s exact, by-design zeroing: the derivative of the max operation with respect to its inputs is 1 for whichever element was the maximum and exactly 0 for every other element in that pooling window. Run a 4x4 max pool and fifteen of sixteen incoming gradient paths are mathematically zero, every single time, regardless of network depth. That’s not a bug to fix — it’s the pooling operation functioning as a hard, deterministic router that sends the full gradient signal to exactly one winning position per window.
The tempting “fix” of switching to average pooling does restore dense gradient flow to every input, but it does so by destroying the property max pooling was chosen for: spatial invariance and preservation of the strongest activation. Average pooling dilutes a sharp feature detection signal across the whole window, which usually costs more in feature quality than it gains in gradient coverage.
The tie-breaking detail matters at production scale specifically because of hardware constraints, not mathematical purity. When two elements in a pooling window are exactly equal, the textbook-correct answer is to split the gradient evenly between them. But splitting requires an atomic read-modify-write across threads, and at the memory-bandwidth-bound scale of a GPU kernel, that’s expensive enough that production libraries like cuDNN and PyTorch instead deterministically route the entire gradient to the first maximal index encountered in memory — a correctness compromise made for throughput. If a network genuinely needs denser gradient flow through pooling without giving up the max signal’s sharpness, the right tool is a differentiable smooth approximation like LogSumExp or SoftPool, which leaks a small gradient to near-maximal elements without fully diluting the signal the way averaging does.