Different reductions send different gradients
gradient▲▲△A four-entry pooling window is and its upstream derivative is four. Find max- and average-pooling input gradients. What changes if the window is ?
Hint
The first maximum is unique; the second is tied.
Solution
The unique max routes the upstream derivative to the second entry: . Average pooling sends to every entry, giving .
At the tie, max pooling has no unique ordinary derivative. A valid subgradient has the form for . An implementation storing one argmax can choose one endpoint. A central difference at the tie need not reproduce that choice.
All these subgradients sum to four: increasing every window entry by the same amount increases its maximum by that amount. The reproduction check uses finite differences only at the unique maximum.