pytorch_cluster icon indicating copy to clipboard operation
pytorch_cluster copied to clipboard

Add Haversine distance metric

Open mishooax opened this issue 1 year ago • 0 comments
trafficstars

The Haversine (great-circle) distance metric would be IMO a very useful addition. It'd allow for better clustering of points residing on a sphere (particularly for point / node configurations where the Euclidean distance metric is not a good approximation):

https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.haversine_distances.html

I have written a hacky implementation (which essentially replaces the cosine similarity metric with the Haversine), that I can share if anyone would find it useful. But maybe we could find a better way to integrate this in the torch-cluster API, if there is interest?

mishooax avatar Aug 22 '24 20:08 mishooax