hinge and log loss update derivations