🤖 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

最后一批可能不满。