ggfm.models.PT_HGNN¶
- class ggfm.models.PT_HGNN(gnn, rem_edge_list, attr_decoder, types, neg_samp_num, device, neg_queue_size=0)[source]¶
PT-HGNN the model for heterogeneous graph neural network with pre-training. Composed of a GNN, a link prediction decoder, an attribute prediction decoder, and a text prediction decoder.
- forward(node_feature, node_type, edge_time, edge_index, edge_type)[source]¶
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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- link_loss(node_emb, rem_edge_list, ori_edge_list, node_dict, target_type, use_queue=True, update_queue=False, relation_level=False)[source]¶
- structure_loss(node_emb, rem_edge_list, ori_edge_list, node_dict, target_type, use_queue=True, update_queue=False, relation_level=False)[source]¶
- training: bool¶