Implementing custom loss function in MatConvNet

292 Views Asked by At

I want to implement a custom loss function (from this paper: https://arxiv.org/abs/1706.00909) in MatConvNet.

My code uses the DagNN wrapper. I want to modify the class SegmentationLoss() to use a custom loss function, custom_loss() instead of vl_nnloss(). For the forward() pass, custom_loss() returns the calculated loss value.

What I don't understand is what custom_loss() should do during the backward() pass in SegmentationLoss(). What is the additional input derOutputs, where does it come from and what should be the return value of custom_loss()?

Thanks!

0

There are 0 best solutions below