easygraph.functions.graph_embedding.line module#

class easygraph.functions.graph_embedding.line.LINE(*args: Any, **kwargs: Any)[source]#

Bases: Module

Graph embedding via LINE. :param G: :type G: easygraph.Graph or easygraph.DiGraph :param dimension: :type dimension: int :param walk_length: :type walk_length: int :param walk_num: :type walk_num: int :param negative: :type negative: int :param batch_size: :type batch_size: int :param init_alpha: :type init_alpha: float :param order: :type order: int

Returns:

embedding_vector – The embedding vector of each node

Return type:

dict

Examples

>>> model = LINE(
...          dimension=128,
...          walk_length=80,
...          walk_num=20,
...          negative=5,
...          batch_size=128,
...          init_alpha=0.025,
...          order=3  )
>>> model.train()
>>> emb = model(g, return_dict=True) # g: easygraph.Graph or easygraph.DiGraph

References

https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/frp0228-Tang.pdf

static add_args(parser)[source]#

Add model-specific arguments to the parser.

classmethod build_model_from_args(args)[source]#
forward(g, return_dict=True)[source]#