我正在使用 CNN 对一些数据进行训练,其中训练大小 = 21700 个样本,测试大小为 653 个样本,并且说我使用的 batch_size 为 500(我也在考虑批量大小的样本)。
我一直在寻找这个很长时间,但无法得到明确的答案,但是在绘制损失函数以检查模型是否过度拟合时,我是否绘制如下
for j in range(num_epochs):
<some training code---Take gradient descent step do wonders>
batch_loss=0
for i in range(num_batches_train):
batch_loss = something....criterion(target,output)...
total_loss += batch_loss
Losses_Train_Per_Epoch.append(total_loss/num_samples_train)#and this is
我需要帮助的地方
Losses_Train_Per_Epoch.append(total_loss/num_batches_train)
and doing the same for Losses_Validation_Per_Epoch.
plt.plot(Losses_Train_Per_Epoch, Losses_Validation_Per_epoch)
所以,基本上,我要问的是,我应该除以 num_samples 还是 num_batches 还是 batch_size?哪一个?