Bayesian Metric Learning frames the problem of learning a task-adapted distance function as probabilistic inference. Rather than producing a single optimal metric matrix, it places a prior over metrics, updates it with pairwise similarity or label constraints, and yields a posterior distribution that quantifies uncertainty about which metric best captures the true structure of the data.
Weinberger, K. Q., & Saul, L. K. (2009). Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 10, 207–244. link ↗