Tensorflow的初始 - 类的数量

Nam*_*los 5 python tensorflow

我想知道Tensorflow的Inception实现中的类数.

在他们的训练脚本中,他们加载由图像和标签组成的训练集.接下来,为了计算损失,他们将数量定义为:

# 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
Run Code Online (Sandbox Code Playgroud)

您可以看到他们使用"未使用的背景类".您还可以在创建训练集时看到此方法:build_image_data.py

那么,为什么你需要这样一个未使用的背景类?(特别是因为您从输出层获得了一个额外但无用的预测)

小智 2

这是我们用于所有图像数据集的约定,对于这个特定模型来说似乎不值得打破它。顺便说一句,我希望所有学术分类数据集在测试评估中都有“以上都不是”类别。一个不知道何时不知道的分类器在实践中没有多大用处。(范霍克)

https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/9G-c2K_GCmk