Comments (5)
I think the problem is likely here:
self.__dict__.update(vars(env)) # Pass values to super wrapper
This trick just gets values from the env class and sets them on the wrapper, if I'm not mistaken. In order for the .mission
field to be updated, we'd need to override the getitem method on the wrappers. Seems doable a-priori. Opinions? How did you run into this problem?
from minigrid.
I ran into that problem while trying to integrate the Fetch environment within my homemade rl framework to do some multitask learning. This bug hasn't really caused me any problem; I'm simply retrieving the mission from the unwrapped environment instead.
Your solution sounds fine : Instead of updating the object's dictionary on initialization, the getitem method could go fetch the unwrapped env's attribute if the wrapper does not have an attribute with the same name (such as self.observation_space).
from minigrid.
@DjAntaki would you like to submit a PR with this improvement? :)
Also, curious. You're building your own RL framework, will that include your own implementation of PPO/A3C/DDPG/etc? Will you be using PyTorch?
from minigrid.
I wrote the override of the __getattr__ function (which is called when __getattribute__ raises an AttributeError) so that it goes retrieve the attribute of self.unwrapped. I then realised that the Wrapper class of gym already has that feature implemented (file core.py line 219). Commenting self.__dict__.update call you mentioned is sufficient to fix the problem. This raises the question as to what purposes that line served. I can submit a pull request with the calls commented.
My framework uses PyTorch; I have my own implementation of Option-Critic and Mixture-Of-Experts networks, the rest algorithm-wise mostly come from other repositories. I built it out of nostalgia for the TrainingLoop class of the Blocks framework.
Si tu veux on peut causer plus amplement sur le slack du mila, je risque d'y être plus rapide pour répondre. @antakiv
from minigrid.
I wrote the override of the getattr function (which is called when getattribute raises an AttributeError) so that it goes retrieve the attribute of self.unwrapped. I then realised that the Wrapper class of gym already has that feature implemented (file core.py line 219). Commenting self.dict.update call you mentioned is sufficient to fix the problem. This raises the question as to what purposes that line served. I can submit a pull request with the calls commented.
Ha! I didn't know that. I'm not the one who originally added that line. Possibly, OpenAI Gym wrappers didn't always have this functionality... Or whoever did this has no idea what they were doing. Let's remove them all, and if the automated tests pass, good enough.
My framework uses PyTorch; I have my own implementation of Option-Critic and Mixture-Of-Experts networks, the rest algorithm-wise mostly come from other repositories. I built it out of nostalgia for the TrainingLoop class of the Blocks framework.
Very cool. I generally find most frameworks out there overcomplicated. They require too much boiletplate and have too many dependencies, are too easily broken. That would be my two cents. Minimize dependencies, keep the API simple and avoid implementing features people won't need.
Did not realize you were at Mila!
from minigrid.
Related Issues (20)
- [Question] Use of 'direction' in observation space? HOT 1
- [Bug Report] Toggling the box will make it disappear HOT 2
- [Bug Report] Error when creating BabyAI environment HOT 2
- [Question] Field of view algorithm explanation
- [Question] What do you mean by "done" action in the action space? HOT 3
- [Bug Report] Spec.to_json() of SimpleCrossing fails
- [Question] Getting total number of unique states HOT 1
- [Question] How to create vectorized envs for minigrid HOT 3
- [Bug Report] Unlock Pickup env is actually just Unlock HOT 4
- [Question] Difference between Minigrid and BabyAI envs HOT 1
- [Question] Is `ActionBonus` wrapper correct ? HOT 1
- [Question] How to build custom environment with custom action space HOT 1
- Python 3.11 support is missing from the README
- [Proposal] Update documentation HOT 3
- [Proposal] Add relevant project
- [Proposal] Discrete observations
- [Bug Report] ViewSizeWrapper ignored with RGBImgPartialObsWrapper HOT 1
- [Question] Get demonstration for 'MiniGrid-MultiRoom-N4-S5-v0' HOT 1
- [Bug Report] Cannot decode obs['image'] because of no implementation of agent in minigrid/core/world_object.py
- Accessing Specific Mission in BabyAI HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minigrid.