torch_geometric_signed_directed.nn.directed.DGCNConv

Classes

DGCNConv

An implementatino of the graph convolutional operator from the

Module Contents

class DGCNConv(improved: bool = False, cached: bool = False, add_self_loops: bool = True, normalize: bool = True, **kwargs)

Bases: torch_geometric.nn.conv.MessagePassing

An implementatino of the graph convolutional operator from the Directed Graph Convolutional Network paper. The same as Kipf’s GCN but remove trainable weights.

Parameters:
  • improved (bool, optional) – If set to True, the layer computes \(\mathbf{\hat{A}}\) as \(\mathbf{A} + 2\mathbf{I}\). (default: False)

  • cached (bool, optional) – If set to True, the layer will cache the computation of \(\mathbf{\hat{D}}^{-1/2} \mathbf{\hat{A}} \mathbf{\hat{D}}^{-1/2}\) on first execution, and will use the cached version for further executions. This parameter should only be set to True in transductive learning scenarios. (default: False)

  • add_self_loops (bool, optional) – If set to False, will not add self-loops to the input graph. (default: True)

  • normalize (bool, optional) – Whether to add self-loops and compute symmetric normalization coefficients on the fly. (default: True)

  • **kwargs (optional) – Additional arguments of torch_geometric.nn.conv.MessagePassing.

improved = False
cached = False
add_self_loops = True
normalize = True
reset_parameters()
forward(x: torch.Tensor, edge_index: torch_geometric.typing.Adj, edge_weight: torch_geometric.typing.OptTensor = None) torch.Tensor

Making a forward pass of the graph convolutional operator.

Arg types:
  • x (PyTorch FloatTensor) - Node features.

  • edge_index (Adj) - Edge indices.

  • edge_weight (OptTensor, optional) - Edge weights corresponding to edge indices.

Return types:
  • out (PyTorch FloatTensor) - Hidden state tensor for all nodes.

message(x_j: torch.Tensor, edge_weight: torch_geometric.typing.OptTensor) torch.Tensor
message_and_aggregate(adj_t: torch_geometric.typing.SparseTensor, x: torch.Tensor) torch.Tensor