egc.module.pretrain.ComE package

Subpackages

Submodules

egc.module.pretrain.ComE.community_embeddings_ComE module

Used for creating community embedding

class egc.module.pretrain.ComE.community_embeddings_ComE.Community2Vec(lr)[source]

Bases: object

Class that train the community embedding

fit(model, reg_covar=0, n_init=10)[source]

Fit the GMM model with the current node embedding and save the result in the model :param model: model injected to add the mixture parameters

train(nodes, model, beta, chunksize=150, epochs=1)[source]

egc.module.pretrain.ComE.context_embeddings_ComE module

Used for context_embedding

class egc.module.pretrain.ComE.context_embeddings_ComE.Context2Vec(lr=0.1, window_size=5, workers=1, negative=5)[source]

Bases: object

Class that train the context embedding

train(model, paths, total_nodes, alpha=1.0, node_count=0, chunksize=150)[source]

Update the model’s neural weights from a sequence of paths (can be a once-only generator stream).

Parameters:
  • model – model containing the shared data

  • paths – generator of the paths

  • total_nodes – total number of nodes in the path

  • alpha – trade-off parameter

  • node_count – init of the number of nodes

  • chunksize – size of the batch

Returns:

egc.module.pretrain.ComE.node_embeddings_ComE module

Used for creating node embedding

class egc.module.pretrain.ComE.node_embeddings_ComE.Node2Vec(lr=0.2, workers=1, negative=0)[source]

Bases: object

Create vector for node by using rand_walk path

train(model, edges, chunksize=150, epochs=1)[source]

Update the model’s neural weights from a sequence of paths (can be a once-only generator stream).

Module contents