Giter Club home page Giter Club logo

Comments (4)

williamleif avatar williamleif commented on August 20, 2024

Hi!

This is a great question: We actually use larger window sizes, but we do the random walks as a pre-processing step. In particular, for the unsupervised version you need to specify a file "<train_prefix>-walks.txt" which gives pairs of nodes that co-occur on random walks. You can specify different "window sizes" in how you generate this file. As mentioned in our experiment, we took random walks of length 5, meaning that we used a "window size" of 10 (if that makes sense).

Cheers,
Will

from graphsage.

jermainewang avatar jermainewang commented on August 20, 2024

Got it. Thanks for the explanation.

-Minjie

from graphsage.

vinaysetty avatar vinaysetty commented on August 20, 2024

@williamleif Just wondering why you did not use the deepwalk implementation by the authors for comparison? Did you see any difference in results?

from graphsage.

skx300 avatar skx300 commented on August 20, 2024

Hi!

This is a great question: We actually use larger window sizes, but we do the random walks as a pre-processing step. In particular, for the unsupervised version you need to specify a file "<train_prefix>-walks.txt" which gives pairs of nodes that co-occur on random walks. You can specify different "window sizes" in how you generate this file. As mentioned in our experiment, we took random walks of length 5, meaning that we used a "window size" of 10 (if that makes sense).

Cheers,
Will

Hi Will, it seems like the run_random_walks function in the code only uses window_size 1, also it is hard-coded.

def run_random_walks(G, nodes, num_walks=N_WALKS):
pairs = []
for count, node in enumerate(nodes):
if G.degree(node) == 0:
continue
for i in range(num_walks):
curr_node = node
for j in range(WALK_LEN):
next_node = random.choice(G.neighbors(curr_node))
# self co-occurrences are useless
if curr_node != node:
pairs.append((node,curr_node))
curr_node = next_node
if count % 1000 == 0:
print("Done walks for", count, "nodes")
return pairs

from graphsage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.