torch_geometric.transforms.AddGPSE

class AddGPSE(model: Module, use_vn: bool = True, rand_type: str = 'NormalSE')[source]

Bases: BaseTransform

Adds the GPSE encoding from the “Graph Positional and Structural Encoder” paper to the given graph (functional name: add_gpse). To be used with a GPSE model, which generates the actual encodings.

Parameters:
  • model (Module) – The pre-trained GPSE model.

  • use_vn (bool, optional) – Whether to use virtual nodes. (default: True)

  • rand_type (str, optional) – Type of random features to use. Options are NormalSE, UniformSE, BernoulliSE. (default: NormalSE)