phanein / deepwalk

DeepWalk - Deep Learning for Graphs
http://www.perozzi.net/projects/deepwalk/
Other
2.68k stars 826 forks source link

Deepwalk on Weighted Graph #26

Closed MdAsifKhan closed 8 years ago

MdAsifKhan commented 8 years ago

Hi, I would like to know what should be done to use DeepWalk on weighted Graphs? Do I need to consider weighted random walk or is there any way to run it on Weighted adjacency or Laplacian matrix.

Thanks, Asif

shun1024 commented 8 years ago

Hi,

Just for note.

I implemented one weighted version and stored it in:

https://github.com/shun1024/weighted-deepwalk

GTmac commented 8 years ago

@shun1024 Thanks for the implementation! For weighted graphs, you can generalize the random walk function here: https://github.com/phanein/deepwalk/blob/master/deepwalk/graph.py#L128-L151

Also, introducing alias sampling reduces the time complexity of generating the next node from $O(n)$ to $O(1)$. An implementation of alias sampling can be found here: https://github.com/aditya-grover/node2vec/blob/master/src/node2vec.py

shun1024 commented 8 years ago

@GTmac thanks for suggestion :)

That's pretty great software

anvarisoraya commented 6 years ago

Hello I just want to know how deepwalk without weight can find word frequency. I dont get that i appreciate if any one help

GTmac commented 6 years ago

@anvarisoraya I am not sure if I understand your question, but word frequency is computed by counting the number of occurrences of each word (node) in random walks, which does not assume the input graph to be weighted.