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

How to set seed within the sampling process? #90

Open
jxie-im opened this issue Apr 3, 2024 · 1 comment
Open

How to set seed within the sampling process? #90

jxie-im opened this issue Apr 3, 2024 · 1 comment

Comments

@jxie-im
Copy link

jxie-im commented Apr 3, 2024

I am wondering if anyone can help point to the places where we can set seed?

Thanks!

@WillianFuks
Copy link
Owner

Hi @jxie-im ,

I can't test it now but does the following work?

seed = 24
os.environ['TF_DETERMINISTIC_OPS'] = 'true'
os.environ['PYTHONHASHSEED'] = f'{seed}'
np.random.seed(seed)
random.seed(seed)
tf.random.set_seed(seed)

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