minimal_mjx¶
Starter code for MJX-based reinforcement learning from the Dynamic Mobility Lab. It is built on MuJoCo Playground and Brax PPO. It keeps training, checkpointing and evaluating policies simple.
What you get¶
- A swappable backend. Write an environment once. Run it on JAX/MJX (
jnp) for fast parallel training, or on NumPy and the C MuJoCo bindings (np) for fast, debuggable rollouts. - A base environment class,
SwappableBase, with common reward terms and helpers. - A config-agnostic library. Library functions take plain arguments (
run_dir,ppo_params,network_params, ...).Configis the only code that knows the YAML layout, so you can use your own layout by subclassing it, or skip it entirely.
Install¶
Quick start¶
From the repository root:
# Train the example Cheetah into example/results/cheetah/test/
python -m example.train --config example/cheetah.yaml --no_wandb
# Roll out the latest checkpoint and save a video and reward plot
python -m example.rollout --config example/cheetah.yaml
Where to go next¶
-
A step-by-step walk through
example/train.py, and what a finished run directory looks like. -
Load a checkpoint, roll it out on the NumPy backend, and save a video and reward plot.
-
How
CheetahsubclassesSwappableBase, and what you need to implement for your own robot. -
Every public function and class, organized by module. Use the search bar to jump to any name.