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

Replace remaining calls to legacy np.random.seed() #112

Open
chimaerase opened this issue Nov 17, 2023 · 1 comment
Open

Replace remaining calls to legacy np.random.seed() #112

chimaerase opened this issue Nov 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@chimaerase
Copy link

Thanks for all of your work on TPOT! I and my colleagues use it very often for a variety of synthetic biology research projects.

I'd like to ask that TPOT 2 accept / use only np.random.Generator objects as an alternative to int RNG seeds, and avoid using the global / legacy np.random number generator, even internally, if possible. A quick search through the TPOT2 code at the time of writing (11/17/23), shows this is largely already the case except for 3 remaining instances of the string "random.seed", which refer to the legacy np.random.seed().

Our code sometimes executes multiple TPOTRegressors in parallel, and TPOT 1's dependence on the global np.random generator has caused problems with repeatability. For example, if unpredictable OS-level thread scheduling changes the sequence of calls to the shared np.random.randint() or similar functions. There are workarounds, e.g. using subprocesses instead of threads, but IMO TPOT should be maximally flexible and ideally not require workarounds.

@perib perib added bug Something isn't working enhancement New feature or request labels Nov 20, 2023
@perib perib mentioned this issue Sep 30, 2024
@perib
Copy link
Collaborator

perib commented Sep 30, 2024

the next version addresses this with PR #156. np.random.see has been removed and everything should only rely on np.random.Generator for now.

@perib perib self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants