easygraph.functions.graph_embedding.sdne module#

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

Bases: Dataset

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

Bases: Module

Graph embedding via SDNE.

graph : easygraph.Graph or easygraph.DiGraph

node: Size of nodes

nhid0, nhid1: Two dimensions of two hiddenlayers, default: 128, 64

dropout: One parameter for regularization, default: 0.025

alpha, beta: Twe parameters graph=g: : easygraph.Graph or easygraph.DiGraph

Examples

>>> import easygraph as eg
>>> model = eg.SDNE(graph=g, node_size= len(g.nodes), nhid0=128, nhid1=64, dropout=0.025, alpha=2e-2, beta=10)
>>> emb = model.train(model, epochs, lr, bs, step_size, gamma, nu1, nu2, device, output)

epochs, “–epochs”, default=400, type=int, help=”The training epochs of SDNE”

alpha, “–alpha”, default=2e-2, type=float, help=”alhpa is a hyperparameter in SDNE”

beta, “–beta”, default=10.0, type=float, help=”beta is a hyperparameter in SDNE”

lr, “–lr”, default=0.006, type=float, help=”learning rate”

bs, “–bs”, default=100, type=int, help=”batch size of SDNE”

step_size, “–step_size”, default=10, type=int, help=”The step size for lr”

gamma, # “–gamma”, default=0.9, type=int, help=”The gamma for lr”

step_size, “–step_size”, default=10, type=int, help=”The step size for lr”

nu1, # “–nu1”, default=1e-5, type=float, help=”nu1 is a hyperparameter in SDNE”

nu2, “–nu2”, default=1e-4, type=float, help=”nu2 is a hyperparameter in SDNE”

device, “– device = torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”) “

output “–output”, default=”node.emb”, help=”Output representation file”

Reference

https://www.kdd.org/kdd2016/papers/files/rfp0191-wangAemb.pdf

forward(adj_batch, adj_mat, b_mat)[source]#
savector(adj)[source]#
train(model, epochs=100, lr=0.006, bs=100, step_size=10, gamma=0.9, nu1=1e-05, nu2=0.0001, device='cpu', output='out.emb')[source]#
easygraph.functions.graph_embedding.sdne.get_adj(g)[source]#
easygraph.functions.graph_embedding.sdne.parse_args()[source]#