Skip to main content

dice_loss

Function dice_loss 

Source
pub fn dice_loss(
    graph: &mut Graph,
    prediction: NodeId,
    target: NodeId,
    smooth: f32,
) -> Result<NodeId, ModelError>
Expand description

Dice loss for segmentation.

DiceLoss = 1 - (2 * |P ∩ G| + smooth) / (|P| + |G| + smooth) where prediction and target are probability maps.