Live Layer Preview
| Layer | Input | Output | Parameters | MACs | Status |
|---|
Formula Used
The output dimension uses the padded input, effective kernel, and stride. Dilation expands a kernel without adding weights. Flooring applies when dimensions do not divide evenly.
Output = floor((Input + PaddingBefore + PaddingAfter - EffectiveKernel) / Stride) + 1 EffectiveKernel = Dilation × (Kernel - 1) + 1 Parameters = KernelHeight × KernelWidth × InputChannels × OutputChannels / Groups + Biases MACs = OutputHeight × OutputWidth × OutputChannels × Batch × KernelHeight × KernelWidth × InputChannels / Groups FLOPs ≈ 2 × MACs
How to Use
- Enter the input tensor width, height, channels, and batch size.
- Select a filter size, stride, dilation, padding, and convolution type.
- Choose output, filter, or padding calculation mode.
- Add optional layers for cumulative network analysis.
- Submit the form, then copy or export results.
Example Data
| Scenario | Input | Filter | Stride | Padding | Output |
|---|---|---|---|---|---|
| Common feature extractor | 224 × 224 × 3 | 3 × 3, 64 filters | 1 | Same | 224 × 224 × 64 |
| Spatial downsampling | 224 × 224 × 64 | 3 × 3, 128 filters | 2 | Same | 112 × 112 × 128 |
| Channel projection | 56 × 56 × 256 | 1 × 1, 64 filters | 1 | Valid | 56 × 56 × 64 |
Calculation History
| Time | Input | Filter | Output | Parameters | MACs |
|---|
Frequently Asked Questions
What is a CNN filter?
A CNN filter is a small trainable weight grid. It slides across an input tensor. The operation detects useful local patterns.
How does filter size affect learning?
Larger filters observe more spatial context directly. Smaller filters usually need fewer parameters. Stacked small filters can build wider receptive fields.
What does same padding mean?
Same padding targets an output near input size. Stride one usually preserves spatial dimensions. Some even kernels need asymmetric padding.
Why does the calculator floor dimensions?
Convolution output formulas commonly use floor division. Fractional positions cannot form complete output cells. The calculator warns when truncation occurs.
What is an effective filter size?
Dilation inserts spaces between kernel elements. The weight count remains unchanged. The effective spatial reach becomes larger.
How are grouped parameters calculated?
Grouped convolution splits channels into independent groups. Each group processes fewer input channels. Parameter and compute counts fall accordingly.
What is depthwise convolution?
Depthwise convolution processes each input channel separately. A multiplier may create several outputs per channel. It is usually computationally efficient.
What is pointwise convolution?
Pointwise convolution normally uses a one-by-one kernel. It mixes information across channels. Spatial width and height usually remain unchanged.
Are MACs and FLOPs identical?
A MAC contains one multiplication and accumulation. FLOP conventions vary between tools. This calculator estimates two FLOPs per MAC.