Skip to content
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

defining random state or seed option parameters #47

Open
kahramankostas opened this issue Nov 21, 2021 · 3 comments
Open

defining random state or seed option parameters #47

kahramankostas opened this issue Nov 21, 2021 · 3 comments

Comments

@kahramankostas
Copy link

I need the option to assign random state or seed values to get stable results. I don't think there is such an option.
Unfortunately, my attempts to fix the general seed that I have listed below did not solve the problem.

import random
random.seed(1)
from numpy.random import seed
seed(1)

What can be done about it? Do you have any advice?
thanks in advance

@VHRanger
Copy link
Owner

Thanks.

Are you looking at node2vec specifically? I agree that all the algorithms should support it, however. For Node2vec we'd have to manually seed for the random walks, and once again on when training the network. I don't think it would be too much work to do.

@VHRanger
Copy link
Owner

Seems like the seeding has to be wrapped by numba jit code, see this issue: numba/numba#6002

(Random walks are numba-jitted)

The long term fix will be in the CSRGraphs package as well

@VHRanger
Copy link
Owner

Having looked deeper into it, this is more complex than it seems - we use numba.prange in loops for threading, so setting a numba seed before the multithreaded loop doesn't guarantee replicable results.

It's seemingly unresolved on the numba side; see this issue:

numba/numba#4452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants