0

我有一个用于多标签分类问题的 CNN,作为损失函数,我使用tf.nn.sigmoid_cross_entropy_with_logits.

交叉熵方程中,我希望输出是每个类的概率,但我得到的是 (-∞, ∞) 中的浮点数。

经过一番谷歌搜索后,我发现由于一些内部归一化操作,每行 logits 在被输入方程之前都可以解释为概率。

我对如何实际输出后验概率而不是浮点数以绘制 ROC 感到困惑。

4

1 回答 1

0

tf.sigmoid(logits) gives you the probabilities.

You can see in the documentation of tf.nn.sigmoid_cross_entropy_with_logits that tf.sigmoid is the function that normalizes the logits to probabilities.

于 2017-08-23T09:52:57.870 回答