A metric learning perspective of SVM: on the relation of SVM and LMNN