PlanetAlign.algorithms.SLOTAlign

class SLOTAlign(bases: int = 4, truncate: bool = False, epsilon: float = 0.01, step_size: float = 1, dtype: dtype = torch.float32)[source]

Bases: BaseModel

OT-based method SLOTAlign for unsupervised pairwise attributed network alignment. SLOTAlign is proposed by the paper “Robust Attributed Graph Alignment via Joint Structure Learning and Optimal Transport.” in ICDE 2023.

Parameters:
  • bases (int, optional) – The base number for the model. The default is 4.

  • truncate (bool, optional) – Whether to truncate the node attributes to the first 100 attributes. The default is False.

  • epsilon (float, optional) – The entropy regularization parameter for the Sinkhorn iteration. The default is 1e-2.

  • step_size (float, optional) – The step size for the embedding update. The default is 1.

  • dtype (torch.dtype, optional) – The data type for the model. The default is torch.float32.

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, gid1: int, gid2: int, use_attr: bool = True, total_epochs: int = 900, joint_epochs: int = 100, save_log: bool = True, verbose: bool = True)[source]
Parameters:
  • dataset (Dataset) – The dataset object containing the graphs and anchor links.

  • gid1 (int) – The index of the first graph to be aligned.

  • gid2 (int) – The index of the second graph to be aligned.

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

  • total_epochs (int, optional) – The total number of epochs for the gromov-wasserstein optimization. The default is 900.

  • joint_epochs (int, optional) – The number of epochs for the joint optimization. The default is 100.

  • save_log (bool, optional) – Whether to save the log of the training process. The default is True.

  • verbose (bool, optional) – Whether to print the progress of the optimization. The default is True.