本文介绍了Caffe Train/Test的净输出是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Caffe中训练时,每次迭代都有训练和测试净输出.我知道这就是损失.但是,这是我的批次中的平均损失还是总损失?对分类和回归而言是否一样?

When training in Caffe, there are Train and Test net outputs for each iteration. I know this is the loss. However, is this the average loss over my batch or the total loss? And is this the same for both Classification and Regression?

例如,如果我要批处理100个训练示例,而那次迭代的损失是100,那是否意味着每个示例的平均损失是1?

For example, if I were to have a batch of 100 training examples and my loss over that iteration is 100, does that mean that the average loss per example is 1?

推荐答案

火车损失是上一次训练批次的平均损失.这意味着,如果您的微型批次中有100个训练示例,而您在该迭代中的损失为100,则每个示例的平均损失等于100.

Train loss is the averaged loss over the last training batch. That means that if you have 100 training examples in your mini-batch and your loss over that iteration is 100, then you have the average loss per example equals to 100.

测试损失也是所有测试批次中的平均损失.您指定测试批次大小和测试迭代次数. Caffe将采用#iter这样的迷你批次,评估它们的损失并为您提供平均值.如果为#test_iter x batch_size == testset_size,您将获得整个测试集的平均值.

Test loss is also an averaged loss but over all the test batches. You specify the test batch size and the number of testing iterations. Caffe will take #iter of such mini-batches, evaluate loss for them and provide you an averaged value. If #test_iter x batch_size == testset_size, you will have an averaged value across the full test set.

这篇关于Caffe Train/Test的净输出是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 12:10