Param Counter
Count parameters and fp32 memory for Dense, Conv2D, Embedding, LayerNorm and attention layers.
How it works
A parameter is one learnable number. Each layer type has a closed-form count:
- Dense / Linear:
in × out + out - Conv2D:
k_h × k_w × in_c × out_c / groups + out_c - Embedding:
vocab × dim - LayerNorm:
2 × dim (scale + shift) - Multi-Head Attention:
4 × d² + 4 × d
- Conv2D weights are shared across every spatial position, so the count does not depend on image size.
groupssplits channels into independent sets (depthwise conv usesgroups = in_c). - Attention has four
d×dprojections (query, key, value, output), each with an optional bias of sized. The number of heads splitsdbut does not change the count. - Memory is
params × bytes per parameter, shown in MB (1 MB = 220 bytes). It covers the weights only, not activations, gradients or optimiser state.
Related tools
Conv Shape Calculator
Track tensor shapes through stacked Conv2D, MaxPool and AvgPool layers.
LLM VRAM Estimator
Estimate GPU memory to run or fine-tune an LLM, and see which GPUs it fits on.
LR Schedule Visualiser
Plot learning-rate schedules (cosine, warmup, step, one-cycle…) and overlay up to three.