cog-imperial / entmoot

Multiobjective black-box optimization using gradient-boosted trees
https://entmoot.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
56 stars 12 forks source link

Problem Config should not use global random state #31

Closed TobyBoyne closed 3 months ago

TobyBoyne commented 6 months ago

The suggested API for random number generation in numpy is to use Generator objects, instead of global state. This is because other code can interfere with global state, causing a lack of reproducibility. Changing the global random state outside of ENTMOOT code leads to inconsistent results.

I think we should have a ProblemConfig.rng attribute that handles all random number generation, for more consistency. I also think ENTMOOT should not be using random.random, instead only using numpy (note, I'm not sure if ENTMOOT does use random.random, but that random state is set in ProblemConfig).