Valid convolution output

Problem

Using the cross-correlation convention common in neural-network libraries, apply

K=[100−1]K=\begin{bmatrix}1&0\\0&-1\end{bmatrix}

with stride 11 and no padding to

X=[123456789].X=\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}.

Give the output matrix.

Reveal answer or reference solution

Each output is the top-left patch value minus the bottom-right patch value. The output is

[1−52−64−85−9]=[−4−4−4−4].\begin{bmatrix}1-5&2-6\\4-8&5-9\end{bmatrix}=\begin{bmatrix}-4&-4\\-4&-4\end{bmatrix}.

The kernel is not flipped because the prompt specifies cross-correlation.

Outcome

Previous attempts

Loading attempts saved in this browser…

    Review Screening Results