-
Notifications
You must be signed in to change notification settings - Fork 224
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
Improve random seed setting in ALE examples #239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way to select seeds seems very good in the both examples (single-process and multi-process).
I left a comment on a boundary check.
examples/ale/train_a3c_ale.py
Outdated
# Set different random seeds for different subprocesses. | ||
# If seed=0 and processes=4, subprocess seeds are [0, 1, 2, 3]. | ||
# If seed=1 and processes=4, subprocess seeds are [4, 5, 6, 7]. | ||
assert (args.seed + 1) * args.processes < 2 ** 31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check would be assert (args.seed + 1) * args.processes - 1 < 2 ** 31
. It might be clearer to check it by process_seeds.max() < 2 ** 31
.
Thank you for the review. I fixed the boundary check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge #234 first.
This PR improves default random seed settings in
examples/ale/train_dqn_ale.py
andexamples/ale/train_a3c_ale.py
so that they are deterministic by default.If this is merged, then I'll update other examples as well in another PR.