-
Notifications
You must be signed in to change notification settings - Fork 69
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
Resetting only the vectorized environments that are done? #73
Comments
Hello. Thanks for this question as this is a point I feel it is good to clarify and improve upon. The current situationCurrently, as you say, there are 2 ways to reset an environment:
The way that is currently available to reset done environments is to cycle through the done flags and reset only the done envs as: done # shape = [n_envs]
for i in range(n_envs):
if done[i]:
env.reset_at(i) The ideal situationTo improve efficiency and avoid this for loop. It would be awsome if the Something like: env.reset_at(done) This would be amazing. The only problem is that the A considerationWhat I do for some scenarios I create is to not implment a done function and let all environments be only done after P.S. This change has long been on our TODOs https://github.com/proroklab/VectorizedMultiAgentSimulator?tab=readme-ov-file#todos |
Thank you! Your answer makes sense. I will think over these options. |
Hi, sorry in advance if this isn't the right place to ask these kinds of questions.
I have been playing with VMAS in its vanilla form (no torchRL/RLLib) to try and understand how to implement my own Scenarios, and currently I am confused with how VMAS handles resetting the environment. The reset() function docstring states that it handles resetting "in a vectorized way". From my testing, it seems to me that it resets all vectorized environments.
I was hoping "in a vectorized way" meant that it only reset the environments which were done and left the others alone. I would like it to behave this way to collect episode reward from episodes that are allowed to run until termination, for instance. Does VMAS have this functionality built-in? Am I misunderstanding reset()?
Thank you for the great library, by the way!
The text was updated successfully, but these errors were encountered: