提交 77c6085e 编写于 作者: F fosaken

modify dice_loss

上级 3b995e1d
......@@ -78,4 +78,6 @@ def dice_loss(logit, label, ignore_mask=None, num_classes=2):
label = fluid.layers.cast(label, 'int64')
ignore_mask = fluid.layers.reshape(ignore_mask, [-1, 1])
loss = fluid.layers.dice_loss(logit, label)
label.stop_gradient = True
ignore_mask.stop_gradient = True
return loss
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册