A Survey on Metric Learning for Feature Vectors and Structured Data