Calculation result
Results update after pressing Calculate Output Size.
Detailed calculation
Enter the layer configuration, then calculate the output.
Add the current configuration as a layer. Each new layer automatically receives the previous spatial output and channel count.
No layers have been added.
Standard convolution and pooling
Output size equals floor of the padded input calculation. Dilation expands the kernel without adding parameters. Stride controls the distance between kernel positions.
O = floor((I + Pbefore + Pafter − D(K − 1) − 1) / S + 1)
Transposed convolution
Transposed convolution expands a spatial dimension using stride. Output padding resolves certain shape ambiguities. It does not add ordinary input padding.
O = (I − 1)S − Pbefore − Pafter + D(K − 1) + 1 + OP
Effective kernel size
Dilation inserts spaces between kernel elements conceptually. The effective kernel grows while weights remain unchanged. This increases the receptive field efficiently.
Keff = D(K − 1) + 1
- Choose 1D, 2D, or 3D processing.
- Select convolution, transposed convolution, or pooling.
- Enter input sizes, kernels, strides, dilation, and padding.
- Set channels, filters, groups, batch size, and data type.
- Calculate and review dimensions, parameters, memory, and operations.
- Add layers to build a complete CNN shape sequence.
| Example | Input | Kernel | Stride | Padding | Output |
|---|---|---|---|---|---|
| Same convolution | 32 × 32 | 3 × 3 | 1 × 1 | Same | 32 × 32 |
| Valid convolution | 28 × 28 | 5 × 5 | 1 × 1 | Valid | 24 × 24 |
| Max pooling | 32 × 32 | 2 × 2 | 2 × 2 | Valid | 16 × 16 |
| Transposed convolution | 16 × 16 | 4 × 4 | 2 × 2 | 1 each side | 32 × 32 |
Valid and same padding
Valid padding adds no zeros around the input. Same padding targets an output based on input and stride. Odd padding may become asymmetric across opposite sides.
Stride and dilation
Larger stride normally reduces the spatial output. Dilation enlarges the effective receptive field. Their combined values determine available kernel placements.
Channels, filters, and groups
Filters determine output channels for ordinary convolution. Groups split input and output channels into independent blocks. Depthwise convolution uses one group per input channel.
Framework differences
Frameworks may define same padding and rounding differently. Pooling ceiling mode can produce one extra position. Always compare the displayed assumptions with model documentation.
What determines convolution output size?
Input size, kernel, stride, padding, and dilation determine output size. Channels do not change spatial dimensions. Filters determine the output channel count.
Why does same padding sometimes use unequal sides?
The required total padding can be odd. One side then receives one extra padded value. Frameworks usually place that extra value at the ending side.
What is the effective kernel size?
The effective kernel includes dilation spacing. It equals dilation times kernel minus one, plus one. Parameters still depend on the original kernel dimensions.
Does pooling have trainable parameters?
Standard max and average pooling have no trainable weights. They still require comparisons or additions. Their output memory can remain substantial.
How are grouped convolution parameters calculated?
Each filter sees input channels divided by groups. Kernel weights multiply by all output filters. Bias adds one value per output filter.
What does output padding do?
Output padding adjusts transposed convolution shape ambiguity. It does not create ordinary padded input values. It must usually remain smaller than stride.
Why can a configuration be invalid?
The effective kernel may exceed the padded input. Strides or dimensions may also be nonpositive. Invalid groups can conflict with channel divisibility.
How is output memory estimated?
Output values multiply by bytes per data value. Batch size and channels are included. Temporary framework memory is not included.
Can this calculator model a complete CNN?
Yes, add each calculated layer to the sequence. The next layer receives the previous output shape automatically. The summary totals parameters and estimated operations.