gpt4 book ai didi

python - Tensorflow 的开端——类的数量

转载 作者:太空狗 更新时间:2023-10-30 01:27:42 24 4
gpt4 key购买 nike

我想知道 Tensorflow 的 Inception 中的类数执行。

在他们的 training script ,他们加载由图像和标签组成的训练集。接下来,为了计算损失,他们定义了 number of classes作为:

# 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

你可以看到他们使用了一个“未使用的背景类”。您还可以在他们创建训练集时看到这种方法:build_image_data.py

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

最佳答案

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)

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

关于python - Tensorflow 的开端——类的数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37513147/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com