torch_geometric_signed_directed.nn.directed.DiGCNConv

Classes

DiGCNConv

The graph convolutional operator from the

Module Contents

class DiGCNConv(in_channels: int, out_channels: int, improved: bool = False, cached: bool = True, bias: bool = True, **kwargs)

Bases: torch_geometric.nn.conv.MessagePassing

The graph convolutional operator from the Digraph Inception Convolutional Networks paper. The spectral operation is the same with Kipf’s GCN. DiGCN preprocesses the adjacency matrix and does not require a norm operation during the convolution operation.

Parameters:
  • in_channels (int) – Size of each input sample.

  • out_channels (int) – Size of each output sample.

  • cached (bool, optional) – If set to True, the layer will cache the adj matrix on first execution, and will use the cached version for further executions. Please note that, all the normalized adj matrices (including undirected) are calculated in the dataset preprocessing to reduce time comsume. This parameter should only be set to True in transductive learning scenarios. (default: False)

  • bias (bool, optional) – If set to False, the layer will not learn an additive bias. (default: True)

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

in_channels
out_channels
improved = False
cached = True
weight
reset_parameters()
forward(x: torch.FloatTensor, edge_index: torch.LongTensor, edge_weight: torch.FloatTensor = None) torch.FloatTensor

Making a forward pass of the DiGCN Convolution layer.

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

  • edge_index (PyTorch LongTensor) - Edge indices.

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

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

message(x_j, norm)
update(aggr_out)