tumourkit.segmentation.hovernet.models.hovernet.utils.msge_loss

tumourkit.segmentation.hovernet.models.hovernet.utils.msge_loss(true, pred, focus, device='cuda')

Calculate the mean squared error of the gradients of horizontal and vertical map predictions. Assumes channel 0 is Vertical and channel 1 is Horizontal.

Args:
true: ground truth of combined horizontal

and vertical maps

pred: prediction of combined horizontal

and vertical maps

focus: area where to apply loss (we only calculate

the loss within the nuclei)

Returns:

loss: mean squared error of gradients