Metric Learning for Motion Data