kgcnn.literature.MAT package

Module contents

kgcnn.literature.MAT.make_model(name: str = None, inputs: list = None, input_embedding: dict = None, input_node_embedding: dict = None, input_tensor_type: str = None, input_edge_embedding: dict = None, distance_matrix_kwargs: dict = None, attention_kwargs: dict = None, max_atoms: int = None, feed_forward_kwargs: dict = None, embedding_units: int = None, depth: int = None, heads: int = None, merge_heads: str = None, verbose: int = None, pooling_kwargs: dict = None, output_embedding: str = None, output_to_tensor: bool = None, output_mlp: dict = None, output_tensor_type: str = None)[source]

Make MAT graph network via functional API. Default parameters can be found in kgcnn.literature.MAT.model_default .

Note

We added a linear layer to keep correct node embedding dimension.

Inputs:

list: [node_attributes, node_coordinates, adjacency_matrix, node_mask, adjacency_mask]

  • node_attributes (Tensor): Node attributes of shape (batch, N, F) or (batch, N) using an embedding layer.

  • node_coordinates (Tensor): Node (atomic) coordinates of shape (batch, N, 3).

  • adjacency_matrix (Tensor): Edge attributes of shape (batch, N, N, F) or (batch, N, N) using an embedding layer.

  • node_mask (Tensor): Node mask of shape (batch, N)

  • adjacency_mask (Tensor): Adjacency mask of shape (batch, N, N)

Outputs:

Tensor: Graph embeddings of shape (batch, L) if output_embedding="graph".

Parameters
  • name (str) – Name of the model. Should be “MAT”.

  • inputs (list) – List of dictionaries unpacked in keras.layers.Input. Order must match model definition.

  • input_tensor_type (str) – Input tensor type. Only “padded” is valid for this implementation.

  • input_node_embedding (dict) – Dictionary of embedding arguments unpacked in Embedding layers.

  • input_edge_embedding (dict) – Dictionary of embedding arguments unpacked in Embedding layers.

  • depth (int) – Number of graph embedding units or depth of the network.

  • verbose (int) – Level for print information.

  • distance_matrix_kwargs (dict) – Dictionary of layer arguments unpacked in MATDistanceMatrix.

  • attention_kwargs (dict) – Dictionary of layer arguments unpacked in MATDistanceMatrix.

  • feed_forward_kwargs (dict) – Dictionary of layer arguments unpacked in feed forward MLP.

  • embedding_units (int) – Units for node embedding.

  • heads (int) – Number of attention heads

  • merge_heads (str) – How to merge head, using either ‘sum’ or ‘concat’.

  • pooling_kwargs (dict) – Dictionary of layer arguments unpacked in MATGlobalPool.

  • output_embedding (str) – Main embedding task for graph network. Either “node”, “edge” or “graph”.

  • output_to_tensor (bool) – Whether to cast model output to Tensor.

  • output_mlp (dict) – Dictionary of layer arguments unpacked in the final classification MLP layer block. Defines number of model outputs and activation.

  • output_tensor_type (str) – Output tensor type. Only “padded” is valid for this implementation.

Returns

keras.models.Model