Estimate the parameter count of fully-connected and convolutional layers from layer widths, kernel sizes and channel counts. Useful for model sizing and memory budgeting.
用于快速估算模型规模。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Dense layer | parameters = input size x output size plus biases | Deep learning texts |
| Convolution layer | parameters = kernel area x in channels x out channels plus biases | Deep learning texts |
| Attention block | self attention costs roughly twelve times the square of the model width | Attention Is All You Need |
全连接层参数=(输入维度+1)×输出维度,+1 为偏置。