[Feature Request] same random seed for every env in AsyncEval #253
Labels
check the checklist
You have checked the required items in the checklist but you didn't do what is written...
enhancement
New feature or request
🚀 Feature
When training with ARS in combination with AsyncEval, multiple environments are run at the same time. When seeding these environments, all environments get a different seed. There should be an option to seed all the environments with the same seed at the start of each time ARS.evaluate_candidates() is run.
stable-baselines3-contrib/sb3_contrib/ars/ars.py
Line 165 in 5c81398
stable-baselines3-contrib/sb3_contrib/common/vec_env/async_eval.py
Line 154 in 5c81398
Motivation
Some environments have random values generated in the reset function, for instance external factors that are random. When running evaluate_candidates, these random values can have an effect on the returned rewards, which makes that some good sets of params get bad rewards and bad params get good rewards. This makes training slower. In order to mitigate this, while still generating different random values for external values, all environments in AsyncEval should be seeded with the same random number at the start of evaluate_candidates, or this should at least be an option.
Pitch
Add the following lines to the start of ARS.evaluate_candidates:
Add the following lines to AsyncEval.seed
And change the worker so that it doesnt return values after seed:
Alternatives
None.
Additional context
At least in my specific environment this method leads to great improvements in training.
Checklist
The text was updated successfully, but these errors were encountered: