oa::ml::loss::l1

Compute mean absolute error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Equal prediction and target values use the zero subgradient. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.

FnRust public API

Function Documentation

pub fn l1( prediction: &Matrix, target: &Matrix ) -> Result<Matrix>
Compute mean absolute error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Equal prediction and target values use the zero subgradient. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.