We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0
from gymnasium.spaces import Dict, Box, Discrete from gymnasium import spaces observation_space = Dict({"position": Box(-1, 1, shape=(2,)), "color": Discrete(5)}, seed=42) flatten = spaces.flatten_space(observation_space) obs1 = flatten.sample() unflat = spaces.utils.unflatten(observation_space,obs1) print(obs1) print(unflat)
obs1:
array([ 0.47568119, 0.64470851, 0.93992918, 0.0658021 , 0.74573835, 0.68031875, -0.96546865])
unflat:
OrderedDict({'color': 0, 'position': array([ 0.6803188 , -0.96546865], dtype=float32)})
The result of unflat will always gives color = 0, even though it is not in obs1`
unflat
color
, even though it is not in
The text was updated successfully, but these errors were encountered:
No branches or pull requests
obs1:
unflat:
The result of
unflat
will always givescolor
= 0, even though it is not in
obs1`The text was updated successfully, but these errors were encountered: