torch_geometric_signed_directed.nn.signed.SIMPA =============================================== .. py:module:: torch_geometric_signed_directed.nn.signed.SIMPA Classes ------- .. autoapisummary:: torch_geometric_signed_directed.nn.signed.SIMPA.SIMPA Module Contents --------------- .. py:class:: SIMPA(hop: int, fill_value: float, directed: bool = False) Bases: :py:obj:`torch.nn.Module` The signed mixed-path aggregation model from the `SSSNET: Semi-Supervised Signed Network Clustering `_ paper. :Parameters: * **hop** (*int*) -- Number of hops to consider. * **fill_value** (*float*) -- Value for added self-loops for the positive part of the adjacency matrix. * **directed** (*bool, optional*) -- Whether the input network is directed or not. (default: :obj:`False`) .. py:attribute:: conv_layer_p .. py:attribute:: conv_layer_n .. py:method:: forward(edge_index_p: torch.LongTensor, edge_weight_p: torch.FloatTensor, edge_index_n: torch.LongTensor, edge_weight_n: torch.FloatTensor, x_p: torch.FloatTensor, x_n: torch.FloatTensor, x_pt: Optional[torch.FloatTensor] = None, x_nt: Optional[torch.FloatTensor] = None) -> Tuple[torch.FloatTensor, torch.FloatTensor, torch.LongTensor, torch.FloatTensor] Making a forward pass of SIMPA. Arg types: * **edge_index_p, edge_index_n** (PyTorch FloatTensor) - Edge indices for positive and negative parts. * **edge_weight_p, edge_weight_n** (PyTorch FloatTensor) - Edge weights for positive and nagative parts. * **x_p** (PyTorch FloatTensor) - Souce positive hidden representations. * **x_n** (PyTorch FloatTensor) - Souce negative hidden representations. * **x_pt** (PyTorch FloatTensor, optional) - Target positive hidden representations. Default: None. * **x_nt** (PyTorch FloatTensor, optional) - Target negative hidden representations. Default: None. Return types: * **feat** (PyTorch FloatTensor) - Embedding matrix, with shape (num_nodes, 2*input_dim) for undirected graphs and (num_nodes, 4*input_dim) for directed graphs.