torch_geometric.transforms.RootedRWSubgraph

class RootedRWSubgraph(walk_length: int, repeat: int = 1)[source]

Bases: RootedSubgraph

Collects rooted random-walk based subgraphs for each node in the graph, as described in the “From Stars to Subgraphs: Uplifting Any GNN with Local Structure Awareness” paper.

Parameters:
  • walk_length (int) – the length of the random walk.

  • repeat (int, optional) – The number of times of repeating the random walk to reduce randomness. (default: 1)