我在很多地方看到,对于使用神经网络进行多标签分类,一种有用的损失函数是为每个输出节点使用二元交叉熵。
在Tensorflow中,它看起来像这样:
cost = tf.nn.sigmoid_cross_entropy_with_logits()
这会生成与我们拥有的输出节点数量一样多的值数组。
我的问题是,这个成本函数是否应该平均输出节点的数量?在Tensorflow中看起来像这样:
cost = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits())
每个损失是独立处理的吗?
谢谢。
tf
中它的名字是什么(它们都被称为something_very_long_blah_blah_blah_with_logits
,没有查找就无法记住哪个做了什么)。@GrantWilliams - Andrey Tyukin