🔮 Model FLOPs Estimator

Estimate forward-pass FLOPs from fully-connected and convolutional layer dimensions, to compare model architectures before training.

📐 計算公式 / 原理
卷積 FLOPs ≈ 2·H·W·C_in·C_out·K²;全連線 FLOPs ≈ 2·in·out;MACs ≈ FLOPs / 2
按輸出特徵圖每個元素所需的乘加次數累計:卷積為 K²·C_in 次乘加、輸出 HWC_out 個元素,乘 2 得 FLOPs。1 MAC = 1 次乘加 = 2 FLOPs,硬體標稱算力多用 MACs,對比時要注意單位換算。

📐 計算公式與說明

卷積 FLOPs ≈ 2 × H × W × C_in × C_out × K²
全連線 FLOPs ≈ 2 × in × out

FLOPs 衡量模型計算量。