sigmoid_cross_entropy_with_logits 跑不起来
Created by: Angus07
prob = fluid.layers.fc(
input=prediction, size=class_dim,act='sigmoid')
cost = fluid.layers.cross_entropy(input=prob, label=label, soft_label= True)
cost = fluid.layers.mean(x=cost)
和 cost = fluid.layers.sigmoid_cross_entropy_with_logits(input=prob, label=label) 是否等价呢? 同样的输入都是ND的矩阵,上面就跑通,下面就报错。 BOOK中找不到sigmoid_cross_entropy_with_logits的使用例子。