Realm

oa::ml::loss::gaussian_nll

Compute the Gaussian negative log likelihood mean(0.5 * (log var + (x - t)^2 / var) + full * 0.5 * log(2 pi)). variance is clamped below at eps, matching the donor’s stability rule. full adds the constant 0.5 * log(2 pi) term. Errors Returns an error for mismatched, empty, or non-FP32 inputs, nonpositive eps, or when runtime recording fails.

FnRust public API

Function Documentation

pub fn gaussian_nll( prediction: &Matrix, target: &Matrix, variance: &Matrix, eps: f32, full: bool ) -> Result<Matrix>
Compute the Gaussian negative log likelihood mean(0.5 * (log var + (x - t)^2 / var) + full * 0.5 * log(2 pi)). variance is clamped below at eps, matching the donor’s stability rule. full adds the constant 0.5 * log(2 pi) term. Errors Returns an error for mismatched, empty, or non-FP32 inputs, nonpositive eps, or when runtime recording fails.