question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Training reproducibility

See original GitHub issue

Important Note: We do not do technical support, nor consulting and don’t answer personal questions per email. Please post your question on the RL Discord, Reddit or Stack Overflow in that case.

Question

Hey, I am working on an algorithm comparison for my custom environment. The environment generates a random scenario for every rollout. Therefore, training the algorithms based on the same data is preferred.

I have tested with set_random_seed(seed = 1) or env.seed(seed = 1) for the environment. And model = A2C("MlpPolicy", env, seed = 1) for the model.

None of them yields two identical training results.

It is appreciated if you can show me how to set it properly.

Checklist

  • I have read the documentation (required)
  • I have checked that there is no similar issue in the repo (required)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
qgallouedeccommented, Jul 20, 2022

I advise you to take inspiration from the implementation of the numerous environments integrated with gym 0.21: https://github.com/openai/gym/tree/c755d5c35a25ab118746e2ba885894ff66fb8c43

If you have difficulty doing this, I urge you to ask for help on this discord

1reaction
qgallouedeccommented, Jul 20, 2022

Sb3 works with gym 0.21 (for now). The reset method in gym 0.21 doesn’t take any argument.

In gym 0.22 and above, reset takes several args including the seed. You are probably referring to the doc of gym 0.24. Aren’t you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ensuring Training Reproducibility in PyTorch | LearnOpenCV
This blog post shows how to do reproducible training of deep learning models in PyTorch.
Read more >
How to Solve Reproducibility in ML - neptune.ai
Reproducibility challenges in Machine Learning · 1. Lack of records · 2. Changes in data · 3. Hyperparameter inconsistency · 4. Randomness ·...
Read more >
4 Challenges of Reproducibility in the Machine Learning ...
Reproducibility is crucial for developing an ML-based pipeline to provide correctness, credibility, and a baseline for a study. We anticipate that an ML...
Read more >
5 – Reproducibility – Machine Learning Blog | ML@CMU
In this blog post, we will introduce the different types of reproducibility and delve into the reasons for the formulation of these questions...
Read more >
Rigor & Reproducibility: Back to Basics - YouTube
One of NIH's goals is to exemplify and promote the highest level of scientific integrity, public accountability, and social responsibility ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found