instadeepai / jumanji

🕹️ A diverse suite of scalable reinforcement learning environments in JAX
https://instadeepai.github.io/jumanji
Apache License 2.0
583 stars 70 forks source link

[Enhancement] Observation from state in public API #195

Open EdanToledo opened 1 year ago

EdanToledo commented 1 year ago

Is your feature request related to a problem? Please describe

It would be nice to have a standard and publicly exposed function to get an observation from the current environment state. I would imagine almost all environments in jumanji have this function internally but its not exposed and might differ depending on the selected environment. I'm not sure how relevant this would be for various people but i know it could help and libraries such as Gymnax has done it.

Describe the solution you'd like

Publicly exposed and standard function call to get the current observation from an environment state.

Hopefully I haven't missed this functionality already...

carlosgmartin commented 11 months ago

Are you thinking of something along the lines of State.observation or Environment.observe(state)? I personally lean toward the latter, since it keeps State objects free of any constraints. (Related: #211.)

EdanToledo commented 11 months ago

The latter is preferred definitely. I just think it would be useful for quite a few use cases.