Valid padding adds no values around an input. A kernel therefore slides only across positions where it fits completely, producing a smaller output. section 10.1.3
For an input of size n, kernel size k, and stride s, the kernel begins at index 0 and advances by s until its right edge reaches n − 1. Each legal position produces one output, giving o = floor((n − k) / s) + 1. section 10.2
One-dimensional convolution
With input elements x₀ … xₙ₋₁, a kernel [w₀, w₁, w₂], and stride 1, the first outputs are y₀ = w₀x₀ + w₁x₁ + w₂x₂ and y₁ = w₀x₁ + w₁x₂ + w₂x₃. The final window is [xₙ₋₃, xₙ₋₂, xₙ₋₁]; no additional output uses values beyond the input. section 10.1.3
Valid padding implies:
- Preserves only input-supported kernel applications; unlike zero padding, it introduces no artificial border values. section 10.1.3
- Extends independently across dimensions by applying the same output-size reasoning to each dimension. section 10.2
| ms + (k − 1) ≤ (n − 1) |
The boundary inequality shows why the last legal kernel position must remain fully inside the input. section 10.2
