未验证 提交 8100584e 编写于 作者: Z Zeyu Chen 提交者: GitHub

Merge pull request #26 from fosaken/release/v0.1.0

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