Gconv

class src.gconv.Gconv(in_features: int, out_features: int)[source]

Graph Convolutional Layer which is inspired and developed based on Graph Convolutional Network (GCN). Inspired by Kipf and Welling. Semi-Supervised Classification with Graph Convolutional Networks. ICLR 2017.

Parameters
  • in_features – the dimension of input node features

  • out_features – the dimension of output node features

forward(A: torch.Tensor, x: torch.Tensor, norm: bool = True) torch.Tensor[source]

Forward computation of graph convolution network.

Parameters
  • A\((b\times n\times n)\) {0,1} adjacency matrix. \(b\): batch size, \(n\): number of nodes

  • x\((b\times n\times d)\) input node embedding. \(d\): feature dimension

  • norm – normalize connectivity matrix or not

Returns

\((b\times n\times d^\prime)\) new node embedding

training: bool