Example

Example of Pooling with Custom Padding and Stride

Consider a 4imes44 imes 4 input tensor populated with values 00 through 1515. Applying a 3imes33 imes 3 max-pooling layer with padding 11 and stride 22 yields a 2imes22 imes 2 output tensor with elements 5,7,13,155, 7, 13, 15. The padding of 11 extends the input borders so the pooling window can be centered near the edges, and the stride of 22 moves the window two positions per step. This demonstrates how adjusting padding and stride together controls the spatial resolution of the pooling output.

0

1

Updated 2026-05-12

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L