PlanetAlign.algorithms.HOT

class HOT(alpha: float = 0.5, lp: float = 0.1, dtype: dtype = torch.float32)[source]

Bases: BaseModel

OT-based method HOT for multi-network alignment. HOT is proposed by the paper “Hierarchical Multi-Marginal Optimal Transport for Network Alignment” in AAAI 2024.

Parameters:
  • alpha (float, optional) – The trade-off parameter between the RWR similarity and the attribute similarity. Default is 0.5.

  • lp (float, optional) – The regularization parameter for the proximal regularizer. Default is 0.1.

test(dataset: Dataset, gids: List[int] | Tuple[int, ...], metrics: tuple[str] | list[str] = None)
Parameters:
  • dataset (Dataset) – The dataset containing the graphs to be aligned and the training/test data.

  • gids (list[int] or tuple[int, ...]) – The indices of the graphs in the dataset to be aligned.

  • metrics (tuple[str] or list[str], optional) – The metrics to be computed after alignment. Default is None, which computes Hits@K (K=1, 10, 30, 50) and MRR metrics.

train(dataset: Dataset, gids: List[int] | Tuple[int, ...], use_attr: bool = True, in_iters: int = 5, out_iters: int = 50, save_log: bool = True, verbose: bool = True)[source]
Parameters:
  • dataset (Dataset) – The dataset object containing the graphs to be aligned and the anchor links.

  • gids (list of int or tuple of int) – The graph IDs of the graphs to be aligned.

  • use_attr (bool, optional) – Whether to use node attributes for alignment. Default is True.

  • in_iters (int, optional) – Number of inner iterations for the proximal point optimization. Default is 5.

  • out_iters (int, optional) – Number of outer iterations for the proximal point optimization. Default is 50.

  • save_log (bool, optional) – Whether to save the training log. Default is True.

  • verbose (bool, optional) – Whether to print the training log. Default is True.