let hinge_loss y y' = let open MX in let z = 1. $- ( y *@ y' ) in let z = map (Pervasives.max 0.) z in average_rows z