tf.nn.softmax_cross_entropy_with_logits是否考虑了批量大小?

时间:2016-06-05 05:31:28

标签: python tensorflow softmax cross-entropy

问题: {{1}} 会说明批量吗?

在我的LSTM网络中,我提供了不同大小的批量,并且想知道在优化之前是否应该对批量大小的误差进行标准化。

1 个答案:

答案 0 :(得分:1)

documentation中,它表示softmax_cross_entropy_with_logits返回长度等于批量大小的向量。要获得标量成本,您可以在该向量上执行tf.reduce_mean。那么您的损失不会受到批量大小的影响。