torch_geometric_signed_directed.nn.signed.SGCN ============================================== .. py:module:: torch_geometric_signed_directed.nn.signed.SGCN Classes ------- .. autoapisummary:: torch_geometric_signed_directed.nn.signed.SGCN.SGCN Module Contents --------------- .. py:class:: SGCN(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 = False, lamb: float = 5, norm_emb: bool = False, **kwargs) Bases: :py:obj:`torch.nn.Module` The signed graph convolutional network model from the `"Signed Graph Convolutional Network" `_ paper. Internally, the first part of this module uses the :class:`torch_geometric.nn.conv.SignedConv` operator. We have made some modifications to the original model :class:`torch_geometric.nn.SignedGCN` for the uniformity of model inputs. :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 :obj:`None`, which will use TSVD as initial embeddings. * **init_emb_grad** (*bool optional*) -- Whether to set the initial embeddings to be trainable. (default: :obj:`False`) * **lamb** (*float, optional*) -- Balances the contributions of the overall objective. (default: :obj:`5`) * **norm_emb** (*bool, optional*) -- Whether to normalize embeddings. (default: :obj:`False`) .. py:attribute:: node_num .. py:attribute:: in_dim :value: 64 .. py:attribute:: out_dim :value: 64 .. py:attribute:: lamb :value: 5 .. py:attribute:: device .. py:attribute:: pos_edge_index .. py:attribute:: neg_edge_index .. py:attribute:: x .. py:attribute:: conv1 .. py:attribute:: convs .. py:attribute:: lsp_loss .. py:attribute:: structure_loss .. py:method:: reset_parameters() .. py:method:: loss() -> torch.FloatTensor .. py:method:: forward() -> torch.Tensor