Skip to content
New issue

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

How to get observation space, or at least low/high bounds? #360

Open
ikamensh opened this issue May 15, 2023 · 2 comments
Open

How to get observation space, or at least low/high bounds? #360

ikamensh opened this issue May 15, 2023 · 2 comments
Labels
good first issue Good for newcomers

Comments

@ikamensh
Copy link

Hi,

I'm used to having observation_space in gym.Env / VectorEnv classes that tell me how to normalize observations, among other uses. Am I right to think this is missing in brax?

I'm doing

from brax import envs as brax_envs
vecenv = brax_envs.create("halfcheetah", batch_size=training_num)

and I can't find any property along the lines of observation space in the vecenv object

@erikfrey
Copy link
Collaborator

Hello there,

You can get these properties if you use the gym wrapper:

from brax.envs.wrappers import gym
env = gym.VectorGymWrapper(vecenv)
print(env.observation_space)

@btaba
Copy link
Collaborator

btaba commented Jun 9, 2023

Hi @ikamensh , while the observation_space is populated, they're set to inf by default

obs = np.inf * np.ones(self._env.observation_size, dtype='float32')

If you'd like to make a PR to populate it generically, you can use dof limits

limit: Tuple[jp.ndarray, jp.ndarray]

@btaba btaba added the good first issue Good for newcomers label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants