xnn.gnn.models.egt.GraphEmbedding#

class xnn.gnn.models.egt.GraphEmbedding(atom_dim=32, feature_dim=8, node_mlp=(64, 256, 2), edge_mlp=(64, 256, 2), activation='gelu')[source]#

Bases: Module

Embeddings of the atom and bond features, mixed by MLPs and averaged over equivalent atoms and bonds.

Parameters:
  • atom_dim (int) – Width of the element embedding.

  • feature_dim (int) – Width of every other feature embedding.

  • node_mlp (tuple of int) – (hidden, out, layers) of the node and edge MLPs (activated after the last layer too).

  • edge_mlp (tuple of int) – (hidden, out, layers) of the node and edge MLPs (activated after the last layer too).

  • activation (str) – Activation of the MLPs.

forward(node_features, edge_features, atom_class, edge_class)[source]#

Node (n, node_dim) and directed-edge (2 m, edge_dim) embeddings from the features (n, 5) (element index, neighbors, formal charge, ring bonds, smallest ring) and (2 m, 2) (in ring, bond order).

Parameters:
Return type:

tuple[Tensor, Tensor]