cogdl.models.emb.netsmf

Module Contents

Classes

NetSMF

The NetSMF model from the `”NetSMF: Large-Scale Network Embedding as Sparse Matrix Factorization”

class cogdl.models.emb.netsmf.NetSMF(dimension, window_size, negative, num_round, worker)[source]

Bases: cogdl.models.BaseModel

The NetSMF model from the “NetSMF: Large-Scale Network Embedding as Sparse Matrix Factorization” paper.

Args:

hidden_size (int) : The dimension of node representation. window_size (int) : The actual context size which is considered in language model. negative (int) : The number of nagative samples in negative sampling. num_round (int) : The number of round in NetSMF. worker (int) : The number of workers for NetSMF.

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)[source]
_get_embedding_rand(self, matrix)[source]
_path_sampling(self, u, v, r)[source]
_random_walk_matrix(self, pid)[source]