cogdl.models.emb.pte

Module Contents

Classes

PTE

The PTE model from the `”PTE: Predictive Text Embedding through Large-scale Heterogeneous Text Networks”

class cogdl.models.emb.pte.PTE(dimension, walk_length, walk_num, negative, batch_size, alpha)[source]

Bases: cogdl.models.BaseModel

The PTE model from the “PTE: Predictive Text Embedding through Large-scale Heterogeneous Text Networks” paper.

Args:

hidden_size (int) : The dimension of node representation. walk_length (int) : The walk length. walk_num (int) : The number of walks to sample for each node. negative (int) : The number of nagative samples for each edge. batch_size (int) : The batch size of training in PTE. alpha (float) : The initial learning rate of SGD.

static add_args(parser)[source]

Add model-specific arguments to the parser.

classmethod build_model_from_args(cls, args)[source]

Build a new model instance.

train(self, G, node_type)[source]
_update(self, vec_u, vec_v, vec_error, label)[source]
_train_line(self)[source]