Skip to content

Commit

Permalink
Added a debub mode for OpenDoor level (mila-iqia#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcswillems authored and maximecb committed May 28, 2018
1 parent 1cd96a8 commit 1ef1332
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ A work-in-progress review of related work can be found [here](https://www.overle

### OpenDoor

- Environment: The agent is placed in a room with 4 different doors. The environment is done when a door is opened.
- Environment: The agent is placed in a room with 4 different doors. The environment is done when the instruction is executed in the regular mode or when a door is opened in the `debug` mode.
- Instruction: Open a door of:
- a given color or location in `OpenDoor`
- a given color in `OpenDoorColor`
- a given location in `OpenDoorLoc`
- a given color or location in `OpenDoor`
- Level id: `BabyAI-OpenDoor-v0`, `BabyAI-OpenDoorColor-v0`, `BabyAI-OpenDoorLoc-v0`
- Level id: `BabyAI-OpenDoor-v0`, `BabyAI-OpenDoorDebug-v0`, `BabyAI-OpenDoorColor-v0`, `BabyAI-OpenDoorColorDebug-v0`, `BabyAI-OpenDoorLoc-v0`, `BabyAI-OpenDoorLocDebug-v0`
- Evaluate: image & text understanding, memory in `OpenDoor` and `OpenDoorLoc`

<p align="center"><img src="media/OpenDoor.png" width="250"></p>
Expand Down Expand Up @@ -216,7 +216,7 @@ A work-in-progress review of related work can be found [here](https://www.overle

### PickupDist

- Environment: The agent is placed in a room with 5 objects. The environment is done when the instruction is executed in `PickupDist` and when any object is picked in `PickupDistDebug`.
- Environment: The agent is placed in a room with 5 objects. The environment is done when the instruction is executed in the regular mode or when any object is picked in the `debug` mode.
- Instruction: Pick up an object of a given type and color
- Level id: `BabyAI-PickupDist-v0`, `BabyAI-PickupDistDebug-v0`
- Evaluate: image & text understanding
Expand All @@ -234,7 +234,7 @@ A work-in-progress review of related work can be found [here](https://www.overle

### OpenRedBlueDoors

- Environment: The agent is placed in a room with a red door and a blue door facing each other. The environment is done when the instruction is executed in `OpenRedBlueDoors` and when the blue door is opened in `OpenRedBlueDoorsDebug`.
- Environment: The agent is placed in a room with a red door and a blue door facing each other. The environment is done when the instruction is executed in the regular mode or when the blue door is opened in the `debug` mode.
- Instruction: Open the red door then open the blue door
- Level id: `BabyAI-OpenRedBlueDoors-v0`, `BabyAI-OpenRedBlueDoorsDebug-v0`
- Evaluate: image understanding, memory
Expand All @@ -243,7 +243,7 @@ A work-in-progress review of related work can be found [here](https://www.overle

### OpenTwoDoors

- Environment: The agent is placed in a room with a red door and a blue door facing each other. The environment is done when the instruction is executed in `OpenTwoDoors` and when the second door is opened in `OpenTwoDoorsDebug`.
- Environment: The agent is placed in a room with a red door and a blue door facing each other. The environment is done when the instruction is executed in the regular mode or when the second door is opened in the `debug` mode.
- Instruction: Open the door of color X then open the door of color Y
- Level id: `BabyAI-OpenTwoDoors-v0`, `BabyAI-OpenTwoDoorsDebug-v0`
- Evaluate: image & text understanding, memory
Expand Down
19 changes: 19 additions & 0 deletions babyai/levels/levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ def gen_mission(self):

self.place_agent(1, 1)
self.instrs = [Instr(action="open", object=object)]

class Level_OpenDoorDebug(Level_OpenDoor):
"""
Same as OpenDoor but the level stops when any door is opened
"""

def reset(self, **kwargs):
obs = super().reset(**kwargs)
Expand Down Expand Up @@ -169,6 +174,13 @@ def __init__(self, seed=None):
seed=seed
)

class Level_OpenDoorColorDebug(Level_OpenDoorColor, Level_OpenDoorDebug):
"""
Same as OpenDoorColor but the level stops when any door is opened
"""

pass

class Level_OpenDoorLoc(Level_OpenDoor):
"""
Go to the door
Expand All @@ -182,6 +194,13 @@ def __init__(self, seed=None):
seed=seed
)

class Level_OpenDoorLocDebug(Level_OpenDoorLoc, Level_OpenDoorDebug):
"""
Same as OpenDoorLoc but the level stops when any door is opened
"""

pass

class Level_GoToObjDoor(RoomGridLevel):
"""
Go to an object or door
Expand Down

0 comments on commit 1ef1332

Please sign in to comment.