PlanetAlign.algorithms.JOENA

class JOENA(alpha: float = 0.7, gamma_p: float = 0.01, init_lambda: float = 1.0, hid_dim: int = 128, out_dim: int = 128, lr: float = 0.0001, dtype: dtype = torch.float32)[source]

Bases: BaseModel

OT-based method JOENA for pairwise network alignment. JOENA is proposed by the paper “Joint Optimal Transport and Embedding for Network Alignment” in WWW 2025.

Parameters:
  • alpha (float, optional) – The hyparameter balancing the Wasserstein and Gromov-Wasserstein distances. Default is 0.7.

  • gamma_p (float, optional) – The weight of proximal operator. Default is 1e-2.

  • init_lambda (float, optional) – The initial value of the threshold lambda. Default is 1.0.

  • hid_dim (int, optional) – The hidden dimension of the MLP. Default is 128.

  • out_dim (int, optional) – The output dimension of the MLP. Default is 128.

  • lr (float, optional) – The learning rate of the optimizer. Default is 1e-4.

  • dtype (torch.dtype, optional) – Data type of the tensors, choose from torch.float32 or torch.float64. 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 = 100, save_log: bool = True, verbose: bool = True)[source]
Parameters:
  • dataset (Dataset) – The dataset containing graphs to be aligned and the training/test data.

  • 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. Default is True.

  • total_epochs (int, optional) – The total number of training epochs. Default is 100.

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

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