oa::ml::loss::soft_margin
Compute the soft margin loss mean(log(1 + exp(-y * x))). Uses the stable softplus form max(z, 0) + log(1 + exp(-|z|)) with z = -y * x, so large margins saturate without overflow. Errors Returns an error for mismatched, empty, or non-FP32 inputs, or when runtime recording fails.
Function Documentation
Compute the soft margin loss mean(log(1 + exp(-y * x))). Uses the stable softplus form max(z, 0) + log(1 + exp(-|z|)) with z = -y * x, so large margins saturate without overflow. Errors Returns an error for mismatched, empty, or non-FP32 inputs, or when runtime recording fails.