RadiusGraph#
- class RadiusGraph(pos, radius, **kwargs)[source]#
Bases:
GraphBuilderExtends the
GraphBuilderclass to computeedge_indexbased on a radius. Each point is connected to all the points within the radius.Instantiate the
Graphclass by computing theedge_indexbased on the radius provided.- Parameters:
pos (torch.Tensor | LabelTensor) – A tensor of shape
(N, D)representing the positions ofNpoints inD-dimensional space.radius (float) – The radius within which points are connected.
kwargs (dict) – The additional keyword arguments to be passed to
GraphBuilderandGraphclasses.
- Returns:
A
Graphinstance with the computededge_index.- Return type:
- static compute_radius_graph(points, radius)[source]#
Computes the
edge_indexbased on the radius. Each point is connected to all the points within the radius.- Parameters:
points (torch.Tensor | LabelTensor) – A tensor of shape
(N, D)representing the positions ofNpoints inD-dimensional space.radius (float) – The radius within which points are connected.
- Returns:
A tensor of shape
(2, E), withEnumber of edges, representing the edge indices of the graph.- Return type: