torch_geometric.transforms.Distance
- class Distance(norm: bool = True, max_value: Optional[float] = None, cat: bool = True, interval: Tuple[float, float] = (0.0, 1.0))[source]
Bases:
BaseTransform将链接节点的欧几里得距离保存在其边属性中 (功能名称:
distance)。每个距离都会全局归一化 到指定的区间(默认情况下为\([0, 1]\))。- Parameters:
norm (bool, optional) – If set to
False, the output will not be normalized. (default:True)max_value (float, optional) – If set and
norm=True, normalization will be performed based on this value instead of the maximum value found in the data. (default:None)cat (bool, optional) – If set to
False, all existing edge attributes will be replaced. (default:True)interval ((float, float), optional) – A tuple specifying the lower and upper bound for normalization. (default:
(0.0, 1.0))