pyagc.transforms.RandomDropEdge
- class RandomDropEdge(p: float = 0.5, edge_attrs: Optional[List[str]] = ['edge_attr'], inplace: bool = False)[source]
Bases:
BaseTransformRandomly drops edges in the graph (functional name:
random_drop_edge), as described in the “DropEdge: Towards Deep Graph Convolutional Networks on Node Classification” paper. Optionally, drops associated edge attributes.- Parameters:
p (float, optional) – The probability of dropping each edge. Must be between 0 and 1. Default is
0.5.edge_attrs (List[str], optional) – The names of edge attributes to drop alongside dropped edges. Default is
["edge_attr"].inplace (bool, optional) – If set to
False, will clone the input data before applying the transform. Default isFalse.
- __init__(p: float = 0.5, edge_attrs: Optional[List[str]] = ['edge_attr'], inplace: bool = False)[source]
Methods
__init__([p, edge_attrs, inplace])forward(data)- rtype:
Union[Data,HeteroData]
- forward(data: Union[Data, HeteroData]) Union[Data, HeteroData][source]
- Return type:
Union[Data,HeteroData]