CNTK: Define a custom loss function (Sørensen-Dice coefficient)
问题 I'd like to use Wiki: Sørensen–Dice coefficient as a loss function in CNTK/Python. How can I define a custom loss function. 回答1: To answer your more general question "How can I define a custom loss function:" In CNTK, loss functions are not special. Any expression that results in a scalar can be used as a loss function. The learner will compute the minibatch-level loss by summing up the scalar loss values of all samples in the minibatch, and backpropagate through it like through any CNTK