Giter VIP home page Giter VIP logo

Comments (5)

maximecb avatar maximecb commented on June 26, 2024

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.

 avatar commented on June 26, 2024

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.

maximecb avatar maximecb commented on June 26, 2024

@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.

 avatar commented on June 26, 2024

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.

maximecb avatar maximecb commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.