-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
[Question] What should be done with the GoalEnv and DiscreteEnv classes? #2381
Comments
A related issue is what to do with the DiscreteEnv class. It's also included in the toy_text envs not in core.py, which needs to be fixed if we keep it. |
It is quite useful when using multi-goal task with Hindsight Experience Replay (many robotics problem can be framed as such). |
Perhaps I'm missing something here, but why can't the regular Gym class be used? Like, how does this solve a particular problem in this domain? |
It enforces a common API for those type of environments (which is the big strength of Gym): Line 182 in ee0a568
and Line 207 in ee0a568
|
@araffin do you have any thoughts on the utility of the discrete env? |
i don't know much about the DiscreteEnv, but it looks like a good example for tabular RL (so more for pedagogical purposes) |
So I sat down and looked through the code again. I can see the value of the GoalEnv class, but I'm of the opinion that the DiscreteEnv class should be removed (and the remaining toy_text environments should be modified to use the regular Gym base class). |
DiscreteEnv appears to implement a small amount of boilerplate tabular RL code, like sampling the next state according to a probability table. Arguably, this is useful in that it maybe saves a few lines of code, but it also probably could be deleted without being missed (only 3 environments use it currently: Cliff Walking, Frozen Lake, and Taxi). |
Excuse me for my late comments, but please allow me to show my suggestion to keep the class DiscreteEnv. We know that one of the greatest contributions of Gym is to provide unified interfaces for different environments. Without the uniform interfaces, different environments would have their own APIs and the agents designed for different environments would not be migrated to other environments easily. The unified interfaces in Gym include:
Especially, the class DiscreteEnv is a good example of class hierarchy that correctly reflect the taxonomy of POMDP. It is an excellent implementation of finite MDP that I often demo in the class. Uses can not only use the existing finite MDPs in Gym, but also derive their own finite MDP environments upon it. Furthermore, users can use it to implement the optimal DP agent in a uniform way. At large, I encourage abstracting the common part of different environments, rather than the opposite. |
As we have been using Is the way to go to replace inheritance from |
Could you elaborate on your problem a bit more? I asked someone else to read this issue to make sure I wasn't going crazy, but we were both slightly confused what compatibility is broken. |
@michaelfeil You should probably see this #2516 |
Sorry, my question's formulation was not very precise. Since |
As far as I have seen, they suggest avoiding |
See comments from DLR-RM/stable-baselines3#780: ee71299
|
Right now, Gym has a GoalEnv class and Env class as base classes in core.py. The GoalEnv class was added as part of the robotics environments, and impose special requirements on the observation space. From what I can tell, this class has not been used outside of Gym's robotics environments and is largely unnecessary. Unless I'm missing something here, removing this class sounds like the way to go.
The text was updated successfully, but these errors were encountered: