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

[RFC] MJX environment prototype (WIP) #834

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

Kallinteris-Andreas
Copy link
Collaborator

@Kallinteris-Andreas Kallinteris-Andreas commented Dec 10, 2023

I have paused development, waiting for mjx==3.2 & a few updates on FuncEnv

related proposal (read first): #833

Feel free to comment on anything you want, but in particular check the NOTE comments

Checklist

  • base MJX class
  • CartPole based environments (InvertedDoublePendulum, InvertedPendulum)
  • 2D Locomotion environments (HalfCheetah, Hopper, Walker2D)
  • Arm Manipulation environments (Reacher, Pusher)
  • Swimmer Environment (Swimmer)
  • Ant Environments (Ant)
  • Humanoid Environments (Humanoid, HumanoidStandup)
  • validate like Add MuJoCo v5 environments #572
  • Write unit tests

Copy link
Contributor

@ffelten ffelten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool WIP. Cannot wait to have this properly ported. May I ask what are the biggest blocking points?

gymnasium/envs/mujoco/f.py Outdated Show resolved Hide resolved
- exclude_current_positions_from_observation
)

self.observation_space = gymnasium.spaces.Box( # TODO use jnp when and if `Box` supports jax natively
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess we'll need to make spaces compatible with jax to be able to sample in jit compiled training function

gymnasium/envs/mujoco/f.py Outdated Show resolved Hide resolved
gymnasium/envs/mujoco/f.py Outdated Show resolved Hide resolved
self.camera_id = camera_id
self.camera_name = camera_name

return MujocoRenderer(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that jax native too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is not, and the render functions will not be JITable for a while (if ever), because of the structure of the deepming/mujoco project

)


# TODO add vector environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be super simple. It's essentially vmap step and reset

gymnasium/envs/mujoco/f.py Outdated Show resolved Hide resolved
@Kallinteris-Andreas
Copy link
Collaborator Author

Kallinteris-Andreas commented Dec 16, 2023

@ffelten the blocking points are mentioned in the issue #833
we are waiting for some features by the MuJoCo team before we can implement the 3d environments (Ant, Humanoid, HumanoidStandup)

@varadVaidya
Copy link

Thanks for this work. I have a few question regarding the WIP. In particular is there any training script that support the MJX Envs. I am asking this, since the return structure of some of the functions, and no mention of truncated in the environments in the PR suggest that, currently something other way of using these environments.
Please correct me if i am wrong

@Kallinteris-Andreas
Copy link
Collaborator Author

Kallinteris-Andreas commented Feb 22, 2024

@varadVaidya

  1. this is just environments
  2. it uses a pre-release version of FuncEnv https://gymnasium.farama.org/main/api/functional/
  3. while all environments are implemented, most can even be instantiated because we are waiting for features in mujoco-MJX

@Kallinteris-Andreas Kallinteris-Andreas changed the title [RFC] MJX environment prototype [RFC] MJX environment prototype (will be resumed after1.0) Sep 24, 2024
@Kallinteris-Andreas Kallinteris-Andreas changed the title [RFC] MJX environment prototype (will be resumed after1.0) [RFC] MJX environment prototype (WIP) Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants