N Neurarch Architectures Models Checks Data Docs Open the app

Comparisons / ResNet Block vs Simple CNN

ResNet Block vs Simple CNN

What the residual connection costs and what it buys.

Simple CNN has 731K more parameters than ResNet Block: 4 layers added, 4 removed, 2 changed.

Baseline

ResNet Block

Layers
7
Parameters
74K
Input
64 × 32 × 32
Output
64 × 32 × 32
Forward-passes
yes
Est. train cost
$0.045
Compared

Simple CNN

Layers
7
Parameters
805K
Input
1 × 28 × 28
Output
10
Forward-passes
yes
Est. train cost
$0.042

The deltas

Every number is Simple CNN relative to ResNet Block.

Parameters
+731K (11× the size)
Layers
0
Added
4
Removed
4
Changed
2
Unchanged
3

Which GPUs each one fits

Each side is measured at its own declared input (64 × 32 × 32 against 1 × 28 × 28). Both columns are right about their own model; the difference between them is not a fact about the designs.

GPUResNet BlockSimple CNN
T4 16GBfitsfits
A100 40GBfitsfits
H100 80GBfitsfits

Layer by layer

Aligned in topological order. 3 of 13 rows are the same layer with the same parameters.

Hide all 13 rows
ResNet BlockSimple CNN
LayerParamsOutputLayerParamsOutput
1changed
shape
Input
Input
64 × 32 × 32Input
Input
1 × 28 × 28
2changed
outChannels
Conv2D_1
Conv2d
64064 × 32 × 32Conv2D_1
Conv2d
32032 × 28 × 28
3removedBatchNorm_1
Batch Norm
64 × 32 × 32
4sameReLU_1
Relu
64 × 32 × 32ReLU_1
Relu
32 × 28 × 28
5removedConv2D_2
Conv2d
64064 × 32 × 32
6removedBatchNorm_2
Batch Norm
64 × 32 × 32
7removedAdd
Add
64 × 32 × 32
8addedMaxPool2D_1
Maxpool2d
32 × 14 × 14
9addedFlatten
Flatten
6272
10addedLinear_1
Linear
128
11sameReLU_2
Relu
64 × 32 × 32ReLU_2
Relu
128
12addedLinear_2
Linear
10
13sameOutput
Output
64 × 32 × 32Output
Output
10

What this is not

Take it further

Open either graph in the editor, change it, and check it again: ResNet Block · Simple CNN

Compare any two models of your own, including anything on Hugging Face: the comparison tool.

Machine-readable: this page as markdown · the pair index · POST https://www.neurarch.com/api/v1/plan for a graph of your own.

Related comparisons

ResNet Block vs ViT-B/16
Convolution against attention for images.