A spatial prior encodes the belief that nearby positions are more related than distant positions. Convolutions impose this bias by applying a filter across local regions, producing outputs that highlight learned patterns. section 3.2
For images, neighboring pixels often share similar values, and the same local relationship can occur anywhere. The idea also applies to sequences: a 1D convolution treats nearby words as related, preserving some order information without requiring the exact full order modeled by an RNN. section 3.2 section 12.3
From pixels to words
A filter can identify the horizontal line at the top of a handwritten 7. For text, an embedding shaped (B, T, D) can be permuted to (B, D, T), allowing nn.Conv1d to detect local patterns such as negation before a word. section 3.2 section 12.3
Figure 3.4 Example of a convolution. An input image and a filter are combined by the convolution. The output is a new image that has been altered. The purpose of the filter is to identify or recognize certain patterns in the input. In this example, the filter identifies the horizontal line at the top of a numeral 7.
Shows how an input image and filter combine to produce an output that emphasizes a local visual pattern. section 3.2
