Skip to main content

Module mse

Module mse 

Source
Expand description

Mean squared error. Mean squared error loss.

The fp16 path avoids forming (logits − targets)² directly (which overflows for large differences) by factoring out max(|diff|) before squaring, then multiplying it back in after the reduction.

Structs§

MseLoss
Calculate the mean squared error loss from the input logits and the targets.