How is the smooth dice loss differentiable?

半世苍凉 提交于 2019-12-04 08:26:23

Adding smooth to the loss does not make it differentiable. What makes it differentiable is
1. Relaxing the threshold on the prediction: You do not cast y_pred to np.bool, but leave it as a continuous value between 0 and 1
2. You do not use set operations as np.logical_and, but rather use element-wise product to approximate the non-differenetiable intersection operation.

You only add smooth to avoid devision by zero when both y_pred and y_true do not contain any foreground pixels.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!