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

Question about Random seeds #179

Open
Weiweihere opened this issue Feb 16, 2023 · 1 comment
Open

Question about Random seeds #179

Weiweihere opened this issue Feb 16, 2023 · 1 comment
Labels
question Further information is requested

Comments

@Weiweihere
Copy link

❓ Question

Hi developer,

I have met a problem regarding the setting of random seeds, below is the walk configuration:

random.seed(22)

RANDOM_STATE = 22

transformer = RDF2VecTransformer(
Word2Vec(),
walkers=[RandomWalker(max_depth=8,
max_walks=20,
sampler=PageRankSampler(),
# random_state=RANDOM_STATE,
with_reverse=True,
md5_bytes=None,
)],
verbose=2
)

after i set with_reverse=True, i tryed to use below individualy or Simultaneously :

random.seed(22) and

RANDOM_STATE = 22

to make the embedding Reproducible,but it doesn`t work, i want to ask whether i did some thing wrong, or missed something.

Best Regards

@Weiweihere Weiweihere added the question Further information is requested label Feb 16, 2023
@GillesVandewiele
Copy link
Collaborator

Hi, this is due to the internal hashing of Python. To ensure determinism, you need to run it from command line as documented in our README:

PYTHONHASHSEED=42 python generate_embeddings.py

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

No branches or pull requests

2 participants