rusty1s/pytorch_cluster

about radius and radius_graph

alpha-beta-user opened this issue · 5 comments

I want to know how the radius function or radius_graph function is implemented. When I see the source code, torch.ops.torch_cluster.radius gets me. I don't kow how to continue.

and if you can tell me how to calculate the radius function. that is better. I want to use matlab to implement radius. Although the function of radius. but the sequence is not right compared with python.

just like
python
0 0 0 1 1 1 2
2 1 3 6 2 3 4
while matlab
0 0 0 1 1 1 2
1 2 3 2 3 6 6

thanks a lot

I really wish there was an explanation for this. What exactly is Radius_Graph returning?

I really wish there was an explanation for this. What exactly is Radius_Graph returning?

Radius_graph return a 2 x M array. assume that you have two data point cloud, every data point is a 1x3 vector, radius_graph discribles index binding between each point in different data point cloud if the distance between them is satisfied(smaller than r).

I have found a c++ code of radius graph, but i can not run it successfully. After I prepare libtorch, runing get a error:
Microsoft C++ exception c10 error
location is as follows:
AT_DISPATCH_ALL_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, x.scalar_type(), "radius_cpu", [&] {

You are right that the radius routines doesn‘t return sorted outputs according to distance.

Regarding implementation: you can find the implementation here, which gets registered into PyTorch namespace here.

You are right that the radius routines doesn‘t return sorted outputs according to distance.

Regarding implementation: you can find the implementation here, which gets registered into PyTorch namespace here.

Thank for your reply, I get cuda and cpu implementation of radius function.