gigl.src.common.models.pyg.graph.augmentations#

Functions#

drop_feature(x, drop_prob)

GRACE feature dropping function with probability drop_prob.

get_augmented_graph(graph[, edge_drop_ratio, ...])

PyG implementation of DGL transformations. Supports augmentations such as dropping random edges (edge_drop_ratio), dropping random feature components (feat_drop_ratio),

Module Contents#

gigl.src.common.models.pyg.graph.augmentations.drop_feature(x, drop_prob)[source]#

GRACE feature dropping function with probability drop_prob. From: CRIPAC-DIG/GRACE

Parameters:
  • x (torch.Tensor)

  • drop_prob (float)

Return type:

torch.Tensor

gigl.src.common.models.pyg.graph.augmentations.get_augmented_graph(graph, edge_drop_ratio=0.3, feat_drop_ratio=0.3, graph_perm=False)[source]#

PyG implementation of DGL transformations. Supports augmentations such as dropping random edges (edge_drop_ratio), dropping random feature components (feat_drop_ratio), and graph permutation (shuffling the nodes and edges of the graph randomly) https://docs.dgl.ai/en/0.9.x/api/python/transforms.html

Parameters:
  • graph (torch_geometric.data.Data)

  • edge_drop_ratio (float)

  • feat_drop_ratio (float)

  • graph_perm (bool)

Return type:

torch_geometric.data.Data