foam_graph.nn package

Submodules

foam_graph.nn.graph_network module

class foam_graph.nn.graph_network.GraphNetwork(num_node_features: int, num_edge_features: int, num_targets: int, hidden_channels: int, num_hidden: int, num_blocks: int)

Bases: torch.nn.modules.module.Module

Graph Network, as proposed in “Relational inductive biases, deep learning, and graph networks”

Parameters
  • num_node_features (int) – Dimension of the node feature vector.

  • num_edge_features (int) – Dimension of the edge feature vector.

  • num_targets (int) – Dimension of the target vector.

  • hidden_channels (int) – Dimension of the latent space.

  • num_hidden (int) – Number of hidden layers in MLPs.

  • num_blocks (int) – Number of message passing blocks.

forward(data)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool

Module contents

class foam_graph.nn.GraphNetwork(num_node_features: int, num_edge_features: int, num_targets: int, hidden_channels: int, num_hidden: int, num_blocks: int)

Bases: torch.nn.modules.module.Module

Graph Network, as proposed in “Relational inductive biases, deep learning, and graph networks”

Parameters
  • num_node_features (int) – Dimension of the node feature vector.

  • num_edge_features (int) – Dimension of the edge feature vector.

  • num_targets (int) – Dimension of the target vector.

  • hidden_channels (int) – Dimension of the latent space.

  • num_hidden (int) – Number of hidden layers in MLPs.

  • num_blocks (int) – Number of message passing blocks.

forward(data)

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool