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

[Feature Request] Turn off auto-reset #112

Closed
1 task done
jbuckman opened this issue May 14, 2022 · 1 comment
Closed
1 task done

[Feature Request] Turn off auto-reset #112

jbuckman opened this issue May 14, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@jbuckman
Copy link

jbuckman commented May 14, 2022

Motivation

The documentation says auto-reset is enabled by default, but for certain applications it is better to have it turned off.

Solution

When auto-reset is off, terminated environments should not be run. They should continue to return dummy state/action/reward/etc in syncronous mode, and they should never be included in the batch in async mode.

Checklist

  • I have checked that there is no similar issue in the repo (required)
@Trinkle23897
Copy link
Collaborator

Trinkle23897 commented May 14, 2022

but for certain applications

Is that your own customized environment?

When auto-reset is off, terminated environments should not be run.

Actually it has already supported this feature to some extend: see https://github.com/sail-sg/envpool/blob/master/envpool/atari/atari_pretrain_test.py
This script first creates 100 environments to run 100 episodes. When an environment terminates, it will not step anymore. The idea is to use env_id to control the step. So the stepping num_envs will gradually decrease from 100 to 1.

BTW, you can also call reset(action, env_id) to continue the running for a set of envs.

@Trinkle23897 Trinkle23897 added the enhancement New feature or request label May 14, 2022
@Trinkle23897 Trinkle23897 added question Further information is requested and removed enhancement New feature or request labels May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants