pytorch_cluster icon indicating copy to clipboard operation
pytorch_cluster copied to clipboard

return radii for FPS

Open pvnieo opened this issue 5 years ago • 9 comments

Hi,

Thank you for the great library.

Is there a plan to return the radius of the sampled points as well as the points in the function torch_cluster.fps? I mean, I want the function to return (points, radius), where points = (x1, x2, x3, ...) and radius = (r1, r2, r2, ...) and r1 > r2 > r3 > ...

Thank you in advance!

pvnieo avatar Sep 24 '20 15:09 pvnieo

Do you mean the smallest radius to all other nodes?

rusty1s avatar Sep 25 '20 06:09 rusty1s

Hi @rusty1s yes, indeed!

pvnieo avatar Sep 25 '20 09:09 pvnieo

I think we can do this. IMO, this should be quite straightforward to implement, since we just need to write the distances into an additional output vector. I would very much welcome a PR on this if you are willing to contribute :)

rusty1s avatar Sep 27 '20 07:09 rusty1s

Hi @rusty1s ! I have a question! in the file fps.py, you imported torch, and you used the function torch.ops.torch_cluster.fps, but I can't find this function in the pytorch repo, where did it came from?

pvnieo avatar Sep 28 '20 10:09 pvnieo

Those are the CPU/CUDA (csr/cpu/csr/cuda) kernels injected into PyTorch by torch_cluster/__init__.

rusty1s avatar Sep 29 '20 05:09 rusty1s

Hi @rusty1s Concerning the first point chosen (either randomly, or the first point in the data), what should be the radius for the latter? We can either choose to not assign to it a radius, in this case, return N point and (N-1) radius, or assign to it a symbolic radius, like -1, what do you think?

pvnieo avatar Oct 03 '20 15:10 pvnieo

Yes, that's tricky indeed. I prefer to use a vector of N-1, but what is the best may heavily depend on the use-case.

rusty1s avatar Oct 05 '20 06:10 rusty1s

Yes, that's tricky indeed. I prefer to use a vector of N-1, but what is the best may heavily depend on the use-case.

Hi, thanks for your great work. Can you release a new fps function that accpets variable( fps point number) not ratio?

mrqrs avatar Oct 23 '20 09:10 mrqrs

You can track the progress here: https://github.com/rusty1s/pytorch_cluster/pull/85

rusty1s avatar Oct 23 '20 10:10 rusty1s