Logic behind random walk method used in deep walk example!

Deep Walk

To generate a random walk for deep walk node embedding method, a function call to dgl.contrib.sampling.random_walk() was made from the deep walk code which inturn calls _CAPI_DGLRandomWalk() function.

We are trying to build a random walk method based on the transition probability since we could not track back after the method call to _CAPI_DGLRandomWalk(), we could not understand how random walk is performed on DGL graph. Any help related to random walk logic is much appreciated!!


For non-uniform random walks, you can probably try dgl.sampling.random_walk for now.

g = dgl.graph((src, dst))
g.edata['prob'] = torch.FloatTensor(...)   # unnormalized transition probability
paths, _ = dgl.sampling.random_walk(g, beginning_nodes, length=5, prob='prob')