Skip to main content

bce_loss

Function bce_loss 

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

Binary cross-entropy loss for predictions already passed through sigmoid. bce = -mean(target * log(pred) + (1 - target) * log(1 - pred)).

prediction values are clamped to [eps, 1-eps] for numerical stability.