dew.rl.playground
MuJoCo Playground’s MJX environments as dew.rl.env.Envs.
A Playground environment (google-deepmind/mujoco_playground, the playground distribution) already
answers a jittable reset(rng) and step(state, action) with a State holding obs, reward and
done, so the adapter renames those into a TimeStep and nothing more; its episodes run unbounded,
and Playground’s training cuts them with Brax’s episode wrapper, which TimeLimit stands for here.
Playground answers done as a float, 1 where the physics went non-finite in the DM Control suite’s
tasks, which end only by their time limit.
| Name | Summary |
|---|---|
Playground | One Playground environment env (an MjxEnv) as an Env. |
playground | count copies of Playground’s environment name stepped together, each episode cut after episode_length steps of action_repeat repeats, as Playground trains them (wrap_for_brax_training). |
Playground
Section titled “Playground”class Playground(env: MjxEnv = struct.field(pytree_node=False))One Playground environment env (an MjxEnv) as an Env.
Playground.load
Section titled “Playground.load”def load(name: str, *, impl: str = 'jax', **overrides: Override = {}) -> PlaygroundPlayground’s registered environment name under its default config, MJX’s JAX
implementation by default, which runs on any JAX backend (the default config of a DM Control
task names Warp’s, which runs on CUDA alone), and overrides.
Playground.reset
Section titled “Playground.reset”def reset(key: jax.Array) -> tuple[State, TimeStep]Playground.step
Section titled “Playground.step”def step(state: State, action: jax.Array) -> tuple[State, TimeStep]playground
Section titled “playground”def playground( name: str, count: int, *, episode_length: int = 1000, action_repeat: int = 1, impl: str = 'jax', **overrides: Override = {},) -> Envcount copies of Playground’s environment name stepped together, each episode cut after
episode_length steps of action_repeat repeats, as Playground trains them
(wrap_for_brax_training).