🤖 Batch Size and Iterations Calculator

Enter dataset size and batch size to get the number of iterations per epoch, and sanity-check your training loop configuration.

📐 計算公式 / 原理
每輪步數 = ⌈樣本數 / 批次⌉;總步數 = 每輪步數 × 輪數;最後一批大小 = 樣本數 mod 批次(餘 0 則取批次)
引數更新次數由"樣本數/批次"決定而非輪數,直接決定訓練時長與學習率排程橫座標。最後一批不滿時需要決定是否丟棄(drop_last):丟棄可讓 BatchNorm 統計穩定,保留則能多用一點資料。

📐 計算公式與說明

steps_per_epoch = ceil(樣本數 / batch_size)
總步數 = steps × epochs

最後一批可能不滿。