torch_geometric_signed_directed.nn.signed.SNEA
Classes
The signed graph attentional layers operator from the `"Learning Signed |
Module Contents
- class SNEA(node_num: int, edge_index_s: torch.LongTensor, in_dim: int = 64, out_dim: int = 64, layer_num: int = 2, init_emb: torch.FloatTensor = None, init_emb_grad: bool = True, lamb: float = 4)
Bases:
torch.nn.ModuleThe signed graph attentional layers operator from the “Learning Signed Network Embedding via Graph Attention” paper :Parameters: * node_num (int) – The number of nodes.
edge_index_s (LongTensor) – The edgelist with sign. (e.g., torch.LongTensor([[0, 1, -1], [0, 2, 1]]) )
in_dim (int, optional) – Size of each input sample features. Defaults to 64.
out_dim (int, optional) – Size of each output embeddings. Defaults to 64.
layer_num (int, optional) – Number of layers. Defaults to 2.
init_emb – (FloatTensor, optional): The initial embeddings. Defaults to
None, which will use TSVD as initial embeddings.init_emb_grad (bool, optional) – Optimize initial embeddings or not.
lamb (float, optional) – Balances the contributions of the overall objective. (default:
4)
- node_num
- in_dim = 64
- out_dim = 64
- lamb = 4
- device
- pos_edge_index
- neg_edge_index
- x
- conv1
- convs
- weight
- lsp_loss
- structure_loss
- reset_parameters()
- loss() torch.FloatTensor
- forward() torch.Tensor