pygod.nn.encoder#
Personalized Neural Network Encoders
- class pygod.nn.encoder.GNA(in_dim, hid_dim, num_layers, out_dim, dropout=0.0, act=<function relu>)[source]#
Graph Node Attention Network (GNA). See [YZY+21] for more details.
- Parameters:
in_dim (int) – Input dimension of node features.
hid_dim (int) – Hidden dimension of the model.
num_layers (int) – Number of layers in the model.
out_dim (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:
s (torch.Tensor) – Input node embeddings.
edge_index (torch.Tensor) – Edge index.
- Returns:
s – Updated node embeddings.
- Return type: