Code Monkey home page Code Monkey logo

gym_minigrid_4rooms's Introduction

Classic Four Rooms implemented within the Minimalistic Gridworld Environment (MiniGrid)

Requirements:

  • Python 3.5+
  • OpenAI Gym
  • NumPy
  • Matplotlib (optional, only needed for display)

Why this repo?

It is an implementation of the classical FourRooms environemnt from the original options paper. However, here we do not assume that the features are tabular, but rather an image that can be passed through a neural network.

Why modify MiniGrid's repo?

We want the agent to be able to move up, down, left and right. However, in the MiniGrid's repo the agent can turn while remaining in the same location. We want to avoid that as to be able to print insightful plots such as

where a state-dependent function is evaluated and plotteed for each location. This is very useful for debugging.

How to use?

import gym
import gym_minigrid

class Minigrid2Image(gym.ObservationWrapper):
    def __init__(self, env):
        gym.ObservationWrapper.__init__(self, env)
        self.observation_space = env.observation_space.spaces['image']

    def observation(self, observation):
        return observation['image']

from gym_minigrid import wrappers as wrappers
env = wrappers.FullyObsWrapper(gym.make('MiniGrid-FourRooms-v0', max_steps=100))
env = Minigrid2Image(env)

gym_minigrid_4rooms's People

Stargazers

 avatar

Watchers

James Cloos avatar Martin Klissarov avatar

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.