aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.65k stars 914 forks source link

About "walkLength" of node2vec_spark #25

Open HaominYu opened 7 years ago

HaominYu commented 7 years ago

Hi

I have a question about the "walkLength"

OK, this file "Node2vec.scala" github

My point of view has any problem?

Thanks

Best Yu

aijianiula0601 commented 7 years ago

why the variable named as "pathBuuffer" already has 2 elements? actually is empty in my mind.

HaominYu commented 6 years ago

hi, aijianiula0601 You can look the previous code, or run it, have a try

Thanks

ghost commented 6 years ago

I think the total length of walks is (numWalks * walkLength) + 2.

datazhen commented 6 years ago

why the length of walks is |walkLength|+2 instead of |walkLength|+1?

Nirvanada commented 6 years ago

I think @HaominYu is right. The graph initializes the pathBuffer size to 2, which contains the initial vertex and the next node. So the generated sentences length is definitely walkLength + 1.