Convolution Playground

Edit the matrices, adjust stride and padding, and slide the kernel over the input.

Operation:
Convolution mode:

1. Input matrix

Edit values directly. Blue cells show the current window.
๐Ÿ”ต Current kernel window ยท Gray = padded zeros

2. Kernel

Edit the filter weights.

Current calculation

Sum of element-wise products
0

3. Output matrix

Click any output value to inspect its calculation.

Output shape

How convolution works

1. Place the kernel over an input window.
2. Multiply corresponding matrix elements.
3. Sum the products to get one output value.
4. Move the kernel by the chosen stride and repeat.

Output height = floor((input height + top padding + bottom padding โˆ’ kernel height) / stride) + 1.
Output width = floor((input width + left padding + right padding โˆ’ kernel width) / stride) + 1.