Closed DavidLapous closed 9 months ago
Hi David,
Thanks for your comment! This operation is out of the scope of KeOps, since NumPy/PyTorch already provide an optimal workflow:
This is the whole point of sliced metrics: you don't need fancy code to compute them efficiently :-)
Best regards, Jean
Thanks Jean for your answer! I'll stick to my current implementation then ;) -- David
Hi, and many thanks for your work ! I'm trying to optimize some part of my code using pykeops; and one piece that seems pykeops-friendly to me is computing sliced wasserstein kernels, as there is a bunch distance, scalar products and norms to compute there. However, to compute (1d)wasserstein on we need to be able to sort w.r.t. one axis (as the 1d wasserstein distance can be efficiently computed with sort+norm). I basically want to do the following computations to compute a sliced wassersein distance matrix
num_pts, D
num_pts
axis)My issue here is that I cannot find a sort operation on lazytensors to compute the wasserstein 1 distance on the "num_points" axis. Is there such a "sort along one axis" operation ? or is this kind of computation out of scope of this library ? I didn't find a way to do it with geomloss either.