cogdl.models.emb.deepwalk

Module Contents

Classes

DeepWalk

The DeepWalk model from the `”DeepWalk: Online Learning of Social Representations”

class cogdl.models.emb.deepwalk.DeepWalk(dimension, walk_length, walk_num, window_size, worker, iteration)[source]

Bases: cogdl.models.BaseModel

The DeepWalk model from the “DeepWalk: Online Learning of Social Representations” 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. window_size (int) : The actual context size which is considered in language model. worker (int) : The number of workers for word2vec. iteration (int) : The number of training iteration in word2vec.

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]
_walk(self, start_node, walk_length)[source]
_simulate_walks(self, walk_length, num_walks)[source]