**IPS (Images per Second) = (batch_size * accumulate_step) / step_time** , **IPS(Iterations Per Second)** 以及 **FPS(Frames Per Second)** 确实有一些区别,但它们之间是相互关联的。
**三者的区别与联系**
-5. **为什么会有不同的公式?**
- **IPS (Images per Second)** 和 **FPS (Frames Per Second)** 的区别在于是否考虑了 **梯度累积(accumulate_step)**:
- **IPS (Images per Second)** 考虑了梯度累积,因此公式中会乘以 **accumulate_step**。
- **FPS (Frames Per Second)** 通常不考虑梯度累积,直接使用 **batch_size** 计算。
- **IPS (Iterations Per Second)** 只关注迭代次数,不涉及批量大小或梯度累积。
6. **总结**
- **IPS (Images per Second)** 是实际任务中每秒处理的图像数量,考虑了批量大小和梯度累积。
- **IPS (Iterations Per Second)** 是训练过程中每秒完成的迭代次数,仅与每步时间相关。
- **FPS (Frames Per Second)** 是每秒处理的样本数,通常不考虑梯度累积。
在你的例子中:
假如:batch_size = 32,accumulate_step = 8,step_time = 60秒
那么带入公式
- **IPS (Images per Second)** = 4.26
- **IPS (Iterations Per Second)** = 0.017
- **FPS (Frames Per Second)** = 0.533