oa::ml::loss::margin_ranking
Compute the margin ranking loss mean(max(0, -y * (x1 - x2) + margin)). target is the ±1 direction mask matching the input shapes. Errors Returns an error for mismatched, empty, or non-FP32 inputs, or when runtime recording fails.
Function Documentation
Compute the margin ranking loss mean(max(0, -y * (x1 - x2) + margin)). target is the ±1 direction mask matching the input shapes. Errors Returns an error for mismatched, empty, or non-FP32 inputs, or when runtime recording fails.