question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for MultiDiscrete/MultiBinary observation spaces

See original GitHub issue
  • preprocessing.py and policy.py need to be updated (cf Stable-Baselines for the preprocessing)
  • tests using envs from identity_env.py

@rolandgvc is working that one

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
araffincommented, May 14, 2020

Playing devil’s advocate here, but since tuple observation (and action spaces) is on the roadmap, wouldn’t that make this feature a redundancy?

So, yes and no. Yes, because what you describe is equivalent to MultiDiscrete space. No, because supporting MultiDiscrete separately is cleaner and would be anyway a building block, as done in the flatdim() method:

https://github.com/openai/gym/blob/b2727d6fd396f7fe2b19a541ef3a6ea47559cdb3/gym/spaces/utils.py#L24

Also, MultiDiscrete is a very special case when all the sub-spaces are of the same type. Usually, in that case, you don’t need Dict or Tuple spaces (e.g. multiples Box spaces can be re-combined into one).

1reaction
araffincommented, May 10, 2020

but from the two existent implementations I see it return integers.

so, this method is only used in the buffer, good catch, this should return a tuple 😕 (so 1, instead of 1 normally) I have to check again, otherwise, we will need to change slightly the type hint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openai gym - what is an agent I can use with a multi-discrete ...
I have a custom environment with a multi-discrete action space. The action and observation spaces are as follows: Action: MultiDiscrete([ 3 121 ...
Read more >
how to create an OpenAI Gym Observation space with multiple ...
python - how to create an OpenAI Gym Observation space with multiple features - Stack Overflow. Stack Overflow for Teams – Start collaborating ......
Read more >
RL Algorithms — Stable Baselines3 1.7.0a5 documentation
This table displays the rl algorithms that are implemented in the Stable Baselines3 project, along with some useful characteristics: support for discrete/ ...
Read more >
Spaces - Gym Documentation
Superclass that is used to define observation and action spaces. ... mask – An optional mask for multi-discrete, expects tuples with a np.ndarray...
Read more >
Create custom gym environments from scratch — A stock ...
__init__() # Define action and observation space # They must be gym.spaces objects # Example when using discrete actions: self.action_space = spaces.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found