liveBook · Manning

Valid padding

As explained in Math and Architectures of Deep Learning

A convolution padding scheme that adds no extra border values around the input, so the kernel only applies where it fully fits inside the input.

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

How Math and Architectures of Deep Learning covers it

How deep it goes
Derives one-dimensional boundary movement and output size, then extends the calculation across dimensions.
Examples
Uses a one-dimensional size-three kernel, stride-one sliding windows, final valid positions, and output-size equations.
What you can do after
Evaluate/understand convolution output dimensions and identify which kernel positions are legal.
How it connects
Connects convolution with kernel size, stride, zero padding, matrix multiplication, and transposed convolution.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.