Batch 與 Epoch:一小批與一整輪Batch and epoch

IDL115 · CH03 · KP08 · 18/44
保留最後不足一批的資料,才是真的掃過整份資料。 / Keep the final partial batch to cover the dataset.

批次分割Partition

不放回切批:每筆只屬於一個 batch。 / Disjoint batches partition the data.

⋃j=1MBj=D,Bi∩Bj=∅(i≠j)(23),(24)\bigcup_{j=1}^{M}\mathcal B_j=\mathcal D,\quad\mathcal B_i\cap\mathcal B_j=\varnothing\quad(i\ne j)\quad\text{(23),(24)}

每輪更新數Steps per epoch

若保留尾批,M=ceil(n/b);若丟棄,為 floor(n/b)。 / Keeping the remainder uses a ceiling.

M=⌈nb⌉M=\left\lceil\frac nb\right\rceil

實際例子Concrete example

n=10、b=4:4+4+2,3 個 batch;尾批除以 2。 / Three batches; normalize the last by two.