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

Clarification needed regarding num_workers #38

Closed
enochkan opened this issue Nov 20, 2020 · 2 comments
Closed

Clarification needed regarding num_workers #38

enochkan opened this issue Nov 20, 2020 · 2 comments

Comments

@enochkan
Copy link

@dgriff777 thanks again for providing this amazing repo, was wondering if num_workers should be equal to the number of threads instead of the number of cores as suggested in README.md. I'm new to A3C so please bear with me if this is a naive question :P

@dgriff777
Copy link
Owner

Thank you for the kind words.

So you don't have the static number of threads on your computer or server that you are using to run this, so number threads would not be a limiting factor here. As this is using python to achieve true parallelism we must use multiprocessing not multithreading as multithreading is the spawning of new threads within in a process and each process for python is run by its own python interpreter and the GIL (global interpreter lock) inhibits true parallel execution of threads within in a process and instead are executed orderly.

The num_workers parameter is just dictating the number of training processes where a model is trained on the game and then shares its updates by updating a shared model between its each process.

hope that helps

@enochkan
Copy link
Author

Thank you for the clarification! Is this project accepting contributions? Would love to contribute if possible.

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