epoch,batch,steps_per_epoch在模型训练中的关系
epochepoch: 每个epoch代表训练完一次全部train_databatch通过batch_size来控制,将train_data划分成子集,每个子集都有batch_size和样本,作为一个batch。batch_size越大,训练速度越快,对显卡的要求就越高。如果batch_size过小,训练数据就会非常难收敛,导致欠拟合steps_per_epochsteps_per_epoch:这
·
epoch
epoch: 每个epoch代表训练完一次全部train_data
batch
通过batch_size来控制,将train_data划分成子集,每个子集都有batch_size和样本,作为一个batch。
- batch_size越大,训练速度越快,对显卡的要求就越高。
- batch_size过小,训练数据就会非常难收敛,导致欠拟合
steps_per_epoch
steps_per_epoch:这是model.fit里面的参数,也叫iteration,迭代。每一步迭代就是将一个batch数据进行训练,所以 iteration = len(train_data)/batch_size
在模型训练中也可以指定迭代次数,每次迭代更新一次模型参数。
更多推荐
所有评论(0)