Skip to content

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.

NameSummary
PlaygroundOne Playground environment env (an MjxEnv) as an Env.
playgroundcount 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).

dataclass source

class Playground(env: MjxEnv = struct.field(pytree_node=False))

One Playground environment env (an MjxEnv) as an Env.

def load(name: str, *, impl: str = 'jax', **overrides: Override = {}) -> Playground

Playground’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.

def reset(key: jax.Array) -> tuple[State, TimeStep]
def step(state: State, action: jax.Array) -> tuple[State, TimeStep]

function source

def playground(
name: str,
count: int,
*,
episode_length: int = 1000,
action_repeat: int = 1,
impl: str = 'jax',
**overrides: Override = {},
) -> Env

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).