torch_geometric_signed_directed.nn.signed.SiGAT
Classes
The signed graph attention network model (SiGAT) from the `"Signed Graph |
Module Contents
- class SiGAT(node_num: int, edge_index_s, in_dim: int = 20, out_dim: int = 20, init_emb: torch.FloatTensor = None, init_emb_grad: bool = True, **kwargs)
Bases:
torch.nn.ModuleThe signed graph attention network model (SiGAT) from the “Signed Graph Attention Networks” paper.
- Parameters:
node_num ([type]) – Number of node.
edge_index_s (list) – The edgelist with sign. (e.g., [[0, 1, -1]] )
in_dim (int, optional) – Size of each input sample features. Defaults to 20.
out_dim (int) – Size of each output embeddings. Defaults to 20.
init_emb – (FloatTensor, optional): The initial embeddings. Defaults to
None, which will use TSVD as initial embeddings.init_emb_grad (bool optional) – Whether to set the initial embeddings to be trainable. (default:
False)
- in_dim = 20
- out_dim = 20
- node_num
- device
- pos_edge_index
- neg_edge_index
- x
- adj_lists
- edge_lists
- aggs = []
- mlp_layer
- lsp_loss
- reset_parameters()
- map_adj_to_edges(adj_list: List) torch.LongTensor
- get_tri_features(u: int, v: int, r_edgelist: List) Tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
- build_adj_lists(edge_index_s: torch.LongTensor) List
- forward() torch.FloatTensor
- loss() torch.FloatTensor