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

Improve random seed setting in ALE examples #239

Merged
merged 4 commits into from
Feb 15, 2018

Conversation

muupan
Copy link
Member

@muupan muupan commented Feb 14, 2018

Merge #234 first.

This PR improves default random seed settings in examples/ale/train_dqn_ale.py and examples/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.

@muupan muupan changed the title Improve random seed setting in DQN examples Improve random seed setting in ALE examples Feb 15, 2018
Copy link
Member

@toslunar toslunar left a 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.

# 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
Copy link
Member

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.

@muupan
Copy link
Member Author

muupan commented Feb 15, 2018

Thank you for the review. I fixed the boundary check.

Copy link
Member

@toslunar toslunar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@muupan muupan merged commit e8e818e into chainer:master Feb 15, 2018
@muupan muupan deleted the make-examples-deterministic branch February 15, 2018 07:08
@muupan muupan added the example label Jul 23, 2018
@muupan muupan added this to the v0.4 milestone Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants