GOOD.networks.models.GINvirtualnode

The Graph Neural Network from the “Neural Message Passing for Quantum Chemistry” paper.

Classes

VirtualNodeEncoder(config, *args, **kwargs)

The virtual node feature encoder for vGIN.

vGIN(config)

The Graph Neural Network from the "Neural Message Passing for Quantum Chemistry" paper.

vGINEncoder(config, **kwargs)

The vGIN encoder for non-molecule data, using the vGINConv operator for message passing.

vGINFeatExtractor(config, **kwargs)

vGIN feature extractor using the vGINEncoder or vGINMolEncoder.

vGINMolEncoder(config, **kwargs)

The vGIN encoder for molecule data, using the vGINEConv operator for message passing.

class GOOD.networks.models.GINvirtualnode.VirtualNodeEncoder(config: Union[CommonArgs, Munch], *args, **kwargs)[source]

Bases: Module

The virtual node feature encoder for vGIN.

Parameters

config (Union[CommonArgs, Munch]) – munchified dictionary of args (config.model.dim_hidden, config.model.dropout_rate)

class GOOD.networks.models.GINvirtualnode.vGIN(config: Union[CommonArgs, Munch])[source]

Bases: GNNBasic

The Graph Neural Network from the “Neural Message Passing for Quantum Chemistry” paper.

Parameters

config (Union[CommonArgs, Munch]) – munchified dictionary of args (config.model.dim_hidden, config.model.model_layer, config.dataset.dim_node, config.dataset.num_classes, config.dataset.dataset_type, config.model.dropout_rate)

forward(*args, **kwargs) Tensor[source]

The vGIN model implementation.

Parameters
  • *args (list) – argument list for the use of arguments_read. Refer to arguments_read

  • **kwargs (dict) – key word arguments for the use of arguments_read. Refer to arguments_read

Returns (Tensor):

label predictions

class GOOD.networks.models.GINvirtualnode.vGINEncoder(config: Union[CommonArgs, Munch], **kwargs)[source]

Bases: GINEncoder, VirtualNodeEncoder

The vGIN encoder for non-molecule data, using the vGINConv operator for message passing.

Parameters

config (Union[CommonArgs, Munch]) – munchified dictionary of args (config.model.dim_hidden, config.model.model_layer, config.dataset.dim_node, config.model.dropout_rate)

forward(x, edge_index, batch, batch_size, **kwargs)[source]

The vGIN encoder for non-molecule data.

Parameters
  • x (Tensor) – node features

  • edge_index (Tensor) – edge indices

  • batch (Tensor) – batch indicator

  • batch_size (int) – Batch size.

Returns (Tensor):

node feature representations

class GOOD.networks.models.GINvirtualnode.vGINFeatExtractor(config: Union[CommonArgs, Munch], **kwargs)[source]

Bases: GINFeatExtractor

vGIN feature extractor using the vGINEncoder or vGINMolEncoder.

Parameters
  • config (Union[CommonArgs, Munch]) – munchified dictionary of args (config.model.dim_hidden, config.model.model_layer, config.dataset.dim_node, config.dataset.dataset_type, config.model.dropout_rate)

  • **kwargswithout_readout will output node features instead of graph features.

class GOOD.networks.models.GINvirtualnode.vGINMolEncoder(config: Union[CommonArgs, Munch], **kwargs)[source]

Bases: GINMolEncoder, VirtualNodeEncoder

The vGIN encoder for molecule data, using the vGINEConv operator for message passing.

Parameters

config (Union[CommonArgs, Munch]) – munchified dictionary of args (config.model.dim_hidden, config.model.model_layer, config.model.dropout_rate)

forward(x, edge_index, edge_attr, batch, batch_size, **kwargs)[source]

The vGIN encoder for molecule data.

Parameters
  • x (Tensor) – node features

  • edge_index (Tensor) – edge indices

  • edge_attr (Tensor) – edge attributes

  • batch (Tensor) – batch indicator

  • batch_size (int) – Batch size.

Returns (Tensor):

node feature representations