Multiple Metric Learning for Structured Data