Faster computation of LMNN objective