Apply a local filter
For input [1, 3, 2, 4] and filter [1, −1], a stride-one valid cross-correlation gives [1−3, 3−2, 2−4] = [−2, 1, −2]. This example uses the filter as written, without flipping it.
What is shared?
The same filter weights are used at each location. The result is a feature map: each output summarizes a local region of the input. A full layer can learn multiple filters and produce multiple feature maps. Change the second signal value. It appears in two neighboring windows, so a single input can change two filter outputs.
INTERACTIVE EXPLORATION
Slide a shared filter
Move the second input value. Apply the same filter [1, −1] at each valid location, with no padding.
Size depends on choices
Padding, stride and filter size affect output dimensions. With input length 4, filter length 2, stride 1 and no padding, the output length is 3. Many deep-learning libraries call this operation convolution even though the primitive is cross-correlation.
Check your understanding
What is the first output of [1, 3, 2, 4] with [1, −1]?
−2: 1 × 1 + 3 × (−1).