2. pahelix.model_zoo

2.1. pretrain_gnns_model

This is an implementation of pretrain gnns: https://arxiv.org/abs/1905.12265

class pahelix.model_zoo.pretrain_gnns_model.PreGNNAttrmaskModel(model_config)[source]

This is a pretraning model used by pretrain gnns for unsupervised training. It randomly mask the atom_type of some nodes and use the masked atom_type as the predicting target.

Returns

pgl graph_wrapper object for the input compound graph. self.loss: the loss variance of the model.

Return type

self.graph_wrapper

forward(is_test=False)[source]

Build the network.

class pahelix.model_zoo.pretrain_gnns_model.PreGNNContextpredModel(model_config)[source]

This is a pretraning model used by pretrain gnns for unsupervised training. For a given node, it builds the substructure that corresponds to k hop neighbours rooted at the node, and the context substructures that corresponds to the subgraph that is between l1 and l2 hops away from the node. Then the feature space of the subtructure and the context substructures are required to be close.

Returns

pgl graph_wrapper object for the input substruct graph. self.context_graph_wrapper: pgl graph_wrapper object for the input context graph. self.loss: the loss variance of the model.

Return type

self.substruct_graph_wrapper

forward(is_test=False)[source]

Build the network.

class pahelix.model_zoo.pretrain_gnns_model.PreGNNSupervisedModel(model_config)[source]

This is a pretraning model used by pretrain gnns for supervised training.

Returns

pgl graph_wrapper object for the input compound graph. self.loss: the loss variance of the model.

Return type

self.graph_wrapper

forward(is_test=False)[source]

Build the network.

class pahelix.model_zoo.pretrain_gnns_model.PretrainGNNModel(model_config={}, name='')[source]

The basic GNN Model used in pretrain gnns.

Parameters
  • model_config (dict) – a dict of model configurations.

  • name (str) – the prefix of model params.

forward(graph_wrapper, is_test=False)[source]

Build the network.

2.2. protein_sequence_model

class pahelix.model_zoo.protein_sequence_model.ProteinSequenceModel(model_config, name='')[source]
forward(inputs, is_test)[source]

Forward.