In the neural network terminology:
- on epoch = one forward pass and one backward pass of all the training examples
- batch_size = the number of training examples in one forward/backward pass. The higher the batch size, the more memory space you’ll need.
- number of iterations = number of passes, each pass using [batch size] number of examples. To be clear, one pass = one forward pass + one backward pass.
Example: if you have 1000 training examples, and your batch size is 500, then it will take 2 iterations to complete 1 epoch.
epoch: 所有的训练样本完成一轮前向计算和后向传播的计算
batch_size: 由于显卡和计算机内存的限制,一次计算前向传播和后向传播的样本数目
iteration:需要多少次计算,才能完成一个epoch的训练
Batch
为了克服数据量多的问题,我们会选择将数据分成几个部分,即batch,进行训练,从而使得每个批次的数据量是可以负载的。将这些batch的数据逐一送入计算训练,更新神经网络的权值,使得网络收敛。
Batch就是每次送入网络中训练的一部分数据,而Batch Size就是每个batch中训练样本的数量
iterations
iterations就是完成一次epoch所需的batch个数
Epoch
一个epoch指代所有的数据送入网络中完成一次前向计算及反向传播的过程。由于一个epoch常常太大,计算机无法负荷,我们会将它分成几个较小的batches。