pygod.nn.encoder#

Personalized Neural Network Encoders

class pygod.nn.encoder.GNA(in_channels, hidden_channels, num_layers, out_channels, dropout=0.0, act=<function relu>)[source]#

Graph Node Attention Network (GNA). See [YZY+21] for more details.

Parameters:
  • in_channels (int) – Input dimension of node features.

  • hidden_channels (int) – Hidden dimension of the model.

  • num_layers (int) – Number of layers in the model.

  • out_channels (int) – Output dimension of the model.

  • dropout (float, optional) – Dropout rate. Default: 0..

  • act (callable activation function or None, optional) – Activation function if not None. Default: torch.nn.functional.relu.

forward(s, edge_index)[source]#

Forward computation.

Parameters:
Returns:

s – Updated node embeddings.

Return type:

torch.Tensor