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

Environment seeding doesn't allow reproducibility #80

Open
quanvuong opened this issue May 5, 2019 · 3 comments
Open

Environment seeding doesn't allow reproducibility #80

quanvuong opened this issue May 5, 2019 · 3 comments

Comments

@quanvuong
Copy link

Hi Hartikainen,

Thank you for maintaining the repo. Sorry if this is done elsewhere in the code, but shouldn't we set the seed of the environments (both training and eval) after creating them here for reproducibility purposes?

Gym maintains its own internal copy of numpy and use that internal copy to sample the initial state. Setting the seed of the global numpy module does not affect this internal copy of numpy.

Thanks!

@quanvuong
Copy link
Author

I create a self-contained snippet that illustrates the issue. Thank you for your attention!

Capture

@hartikainen
Copy link
Member

Thanks for opening the issue, and sorry for the delayed reply. I think you're right, the way we set the seeds in our code does not guarantee full reproducibility but only that the randomizations are different across the runs.

Without looking too deep into this, I think the env seeding is the only one that's currently making things not reproducible. I would solve this by setting the seeds in the ExperimentRunner._build:

def _build(self):

I can try looking into this at some point, but feel free to submit out a PR if you want to take a stab at it in the meanwhile.

@hartikainen hartikainen changed the title Setting the seeds of the environments Setting environment seeds for reproducibility May 11, 2019
@hartikainen hartikainen changed the title Setting environment seeds for reproducibility Environment seeding doesn't allow reproducibility May 11, 2019
@quanvuong quanvuong reopened this May 11, 2019
@quanvuong
Copy link
Author

Sorry about closing and opening the issue (misclick).

I'm happy to send a PR in. It's literally 2 lines : ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants