[英]Tensorflow's Inception - Number of Classes
I'm wondering about the number of classes in Tensorflow's Inception implementation. 我想知道Tensorflow的Inception实现中的类数。
In their training script , they load the training set consisting of images and labels. 在他们的训练脚本中 ,他们加载由图像和标签组成的训练集。 Next, to calculate the loss, they define the number of classes as:
接下来,为了计算损失,他们将类的数量定义为:
# Number of classes in the Dataset label set plus 1.
# Label 0 is reserved for an (unused) background class.
num_classes = dataset.num_classes() + 1
You can see that they use an "unused background class". 您可以看到他们使用“未使用的背景类”。 You can also see this approach when they create their training set: build_image_data.py
您还可以在创建训练集时看到此方法: build_image_data.py
So, why would you need such an unused background class? 那么,为什么你需要这样一个未使用的背景类? (Especially because you get one additional but useless prediction from the output layer)
(特别是因为您从输出层获得了一个额外但无用的预测)
It's a convention we use for all our image datasets, and it didn't seem worth the trouble to break it for this particular model.
这是我们用于所有图像数据集的惯例,对于这个特定的模型而言,打破它似乎并不值得。 As an aside, I wish all academic classification datasets had a 'none of the above' class in their test evaluation.
顺便说一下,我希望所有的学术分类数据集在他们的测试评估中都没有“上述”类别 。 A classifier which doesn't know when it doesn't know is not that useful in practice.
不知道什么时候不知道的分类器在实践中没有用。 (vanhoucke)
(vanhoucke)
https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/9G-c2K_GCmk https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/9G-c2K_GCmk
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.