is there any function to remove isolated nodes?
i find that modelNet40 containes much more ioslated nodes
There currently is no such functionality in PyTorch Geometric, although this is a good feature request. In the meantime, you can remove isolated nodes by yourself, e.g., with the following (untested) code:
mask = torch.zeros(num_nodes, dtype=torch.uint8)
mask[edge_index.flatten()] = 1
assoc = torch.full((num_nodes, ), -1, dtype=torch.long))
assoc[mask] = torch.arange(mask.sum())
new_edge_index = assoc[edge_index]
new_x = x[mask]
new_pos = pos[mask]
Added to master.
And a transform :)
Most helpful comment
Added to master.