l1_loss

Function l1_loss 

Source
pub fn l1_loss<B>(
    prediction: &Tensor<B>,
    target: &Tensor<B>,
) -> Result<Tensor<B>, Error>
where B: Backend,
Expand description

L1 Loss (Mean Absolute Error): mean(|prediction - target|)

More robust to outliers than MSE because errors grow linearly, not quadratically. Commonly used in regression with noisy targets.

Both prediction and target must have the same shape. Returns a scalar tensor.