New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
an error in walker maybe? #2
Comments
Do You want to open a pull request?
…On Thu, 4 Apr 2019 at 22:25, Nitin Siwach ***@***.***> wrote:
I dont know much about this work in details. however, while implementing i
am running into sample larger than population. I think in src/walker.py
it should be
def small_walk(self, start_node):
"""
Doing a truncated random walk.
:param start_node: Start node for random walk.
:return walk: Truncated random walk with fixed maximal length.
"""
walk = [start_node]
while len(walk) < self.args.walk_length:
if len(nx.neighbors(self.graph,walk[-1])) ==0:
break
walk = walk + [random.sample(nx.neighbors(self.graph,walk[-1]),1)[0]]
return walk
Instead of
def small_walk(self, start_node):
"""
Doing a truncated random walk.
:param start_node: Start node for random walk.
:return walk: Truncated random walk with fixed maximal length.
"""
walk = [start_node]
while len(walk) < self.args.walk_length:
walk = walk + [random.sample(nx.neighbors(self.graph,walk[-1]),1)[0]]
if len(nx.neighbors(self.graph,walk[-1])) ==0:
break
return walk
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AQk2F4zatwEP-6Q6XTjsp69Xvwr7x_O_ks5vdm3ZgaJpZM4cdvg5>
.
|
Corrected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I dont know much about this work in details. however, while implementing i am running into
sample larger than population
. I think in src/walker.py it should beInstead of
The text was updated successfully, but these errors were encountered: