Model convolution layers across common neural architectures. Review formulas, examples, downloads, and dynamic sizing charts. Plan tensor shapes early and reduce debugging surprises later.
This advanced tool covers standard and transposed convolution, asymmetric padding, dilation, groups, bias, and format-aware tensor output.
For a standard convolution, each spatial axis follows this rule:
output = floor((input + pad_before + pad_after - effective_kernel) / stride + 1)
When ceil mode is enabled, the calculator replaces floor with ceil.
effective_kernel = dilation × (kernel - 1) + 1
For a transposed convolution, each spatial axis follows this rule:
output = (input - 1) × stride - pad_before - pad_after + effective_kernel + output_padding
This page calculates height and width independently, then assembles the final tensor using the selected data format.
| Layer | Input | Kernel | Stride | Padding | Dilation | Output |
|---|---|---|---|---|---|---|
| Standard | 224 × 224 | 3 × 3 | 1 × 1 | SAME | 1 × 1 | 224 × 224 |
| Standard | 224 × 224 | 3 × 3 | 2 × 2 | SAME | 1 × 1 | 112 × 112 |
| Standard | 32 × 32 | 5 × 5 | 1 × 1 | VALID | 1 × 1 | 28 × 28 |
| Transposed | 28 × 28 | 4 × 4 | 2 × 2 | Explicit 1,1,1,1 | 1 × 1 | 56 × 56 |
SAME padding adds enough border pixels to preserve spatial size when stride is one. With larger strides, it usually keeps the output close to ceil(input / stride), which many deep learning frameworks use for shape planning.
Dilation spaces kernel elements farther apart, increasing the effective kernel size. A larger effective kernel consumes more spatial extent, so the output gets smaller unless you compensate with more padding.
Output padding resolves shape ambiguity after upsampling. It does not add trainable weights. It only increases the final reported spatial size by a small amount, usually less than the stride.
No. Groups affect channel connectivity and parameter count, not the spatial size formula. They still matter because both input channels and output channels must be divisible by the group count.
If the effective kernel is too large for the padded input, the formula may produce zero or negative dimensions. That usually means the layer settings are not feasible for the current tensor size.
Use the format expected by your framework or deployment target. The spatial result stays the same. Only the reported tensor ordering changes, which helps avoid shape mismatches in model code.
For one convolution layer, the receptive field equals the effective kernel size on each axis. It shows how much of the input can influence one output location before stacking additional layers.
Stride is one of the fastest ways to change resolution. The chart helps you see how aggressive downsampling or upsampling becomes as stride increases, which is useful during architecture design.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.