oa::ml::loss::mse

Compute mean squared error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. 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 mse( prediction: &Matrix, target: &Matrix ) -> Result<Matrix>
Compute mean squared error for matching FP32 matrices. The target is treated as detached; reverse mode differentiates only the prediction. Errors Returns an error for empty, mismatched, non-FP32, or cross-engine inputs, or when allocation or runtime recording fails.

Examples