models.emb.graph2vec

Module Contents

Classes

Graph2Vec

The Graph2Vec model from the `”graph2vec: Learning Distributed Representations of Graphs”

class models.emb.graph2vec.Graph2Vec(dimension, min_count, window_size, dm, sampling_rate, rounds, epoch, lr, worker=4)[source]

Bases: models.BaseModel

The Graph2Vec model from the “graph2vec: Learning Distributed Representations of Graphs” paper

Args:

hidden_size (int) : The dimension of node representation. min_count (int) : Parameter in doc2vec. window_size (int) : The actual context size which is considered in language model. sampling_rate (float) : Parameter in doc2vec. dm (int) : Parameter in doc2vec. iteration (int) : The number of iteration in WL method. epoch (int) : The max epoches in training step. lr (float) : Learning rate in doc2vec.

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.

static feature_extractor(data, rounds, name)[source]
static wl_iterations(graph, features, rounds)[source]
forward(self, graphs, **kwargs)[source]
save_embedding(self, output_path)[source]