cogdl.models.emb.netmf

Module Contents

Classes

NetMF

The NetMF model from the `”Network Embedding as Matrix Factorization: Unifying DeepWalk, LINE, PTE, and node2vec”

class cogdl.models.emb.netmf.NetMF(dimension, window_size, rank, negative, is_large=False)[source]

Bases: cogdl.models.BaseModel

The NetMF model from the “Network Embedding as Matrix Factorization: Unifying DeepWalk, LINE, PTE, and node2vec” paper.

Args:

hidden_size (int) : The dimension of node representation. window_size (int) : The actual context size which is considered in language model. rank (int) : The rank in approximate normalized laplacian. negative (int) : The number of nagative samples in negative sampling. is-large (bool) : When window size is large, use approximated deepwalk matrix to decompose.

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]
_compute_deepwalk_matrix(self, A, window, b)[source]
_approximate_normalized_laplacian(self, A, rank, which='LA')[source]
_deepwalk_filter(self, evals, window)[source]
_approximate_deepwalk_matrix(self, evals, D_rt_invU, window, vol, b)[source]