How suz-tsinghua/smp works
SMP ports motion-prior learning and physics-based G1 control to mjlab. Its main workflow converts motion clips into windows and normalization statistics, trains a DDPM denoiser, then reuses a frozen prior as a guidance reward while PPO trains one of four task policies. The graph also shows the shared RL runtime and task-specific command logic. README and sampled source support the principal links; unsampled task internals are represented only where documented or indexed.
Main entry points: rewards.py SMP task reward · pretrain.py Prior training · env_cfg.py Shared environment · steering_env_cfg.py Steering task
Components 24
Motion data
- Motion CSVs
datasets/csv/forward/g1_walk.csv - Window conversion
scripts/csv_to_npz.py - Motion windows
- Normalization stats
scripts/compute_norm_stats.py
Diffusion prior
- Training dataset
src/smp/pretrain/dataset.py - Diffusion denoiser
src/smp/pretrain/model.py - DDPM scheduler
src/smp/pretrain/scheduler.py - Prior training
scripts/pretrain.py - Prior checkpoints
datasets/pretrain_ckpt/pretrained_loco.pt
RL runtime
- Policy training
scripts/train.py - Shared environment
src/smp/rl/env_cfg.py - Prior initialization
src/smp/rl/events.py - Feature reconstruction
src/smp/sampling/feature_to_state.py - SMP task reward
src/smp/rl/rewards.py - RL feature buffer
src/smp/rl/utils.py - Policy playback
scripts/play.py
G1 tasks
- Forward task
src/smp/rl/tasks/steering/forward_env_cfg.py - Steering task
src/smp/rl/tasks/steering/steering_env_cfg.py - Steering commands
src/smp/rl/tasks/steering/mdp/commands.py - Location task
src/smp/rl/tasks/location/location_env_cfg.py - Location commands
src/smp/rl/tasks/location/mdp/commands.py - Get-up task
src/smp/rl/tasks/getup/getup_env_cfg.py - Get-up termination
src/smp/rl/tasks/getup/mdp/terminations.py
Other components
- Researcher
Connections 31
- Researcher → Window conversion: prepares data
README.md - Motion CSVs → Window conversion: converts clips
README.md - Window conversion → Motion windows: writes windows
README.md - Motion windows → Normalization stats: computes ranges
README.md - Researcher → Prior training: trains prior
README.md - Motion windows → Training dataset: loads windows
- Prior training → Training dataset: uses dataset
scripts/pretrain.py - Prior training → Diffusion denoiser: trains model
scripts/pretrain.py - Prior training → DDPM scheduler: uses diffusion
scripts/pretrain.py - Prior training → Normalization stats: uses statistics
- Prior training → Prior checkpoints: saves prior
README.md - Researcher → Policy training: trains policy
README.md - Policy training → Shared environment: runs task config
README.md - Shared environment → Prior initialization: registers events
src/smp/rl/env_cfg.py - Prior initialization → Prior checkpoints: loads prior
- Prior initialization → Feature reconstruction: reconstructs state
src/smp/rl/events.py - SMP task reward → RL feature buffer: updates buffer
src/smp/rl/rewards.py - SMP task reward → Diffusion denoiser: scores features
src/smp/rl/rewards.py - SMP task reward → DDPM scheduler: adds noise
src/smp/rl/rewards.py - Researcher → Policy playback: plays policy
README.md - Forward task → Shared environment: extends config
src/smp/rl/tasks/steering/forward_env_cfg.py - Steering task → Shared environment: extends config
src/smp/rl/tasks/steering/steering_env_cfg.py - Steering task → Steering commands: configures command
src/smp/rl/tasks/steering/steering_env_cfg.py - Location task → Shared environment: extends config
src/smp/rl/tasks/location/location_env_cfg.py - Location task → Location commands: configures command
src/smp/rl/tasks/location/location_env_cfg.py - Get-up task → Shared environment: extends config
src/smp/rl/tasks/getup/getup_env_cfg.py - Get-up task → Get-up termination: configures termination
src/smp/rl/tasks/getup/getup_env_cfg.py - Forward task → SMP task reward: uses SMP reward
src/smp/rl/tasks/steering/forward_env_cfg.py - Steering task → SMP task reward: uses SMP reward
src/smp/rl/tasks/steering/steering_env_cfg.py - Location task → SMP task reward: uses SMP reward
src/smp/rl/tasks/location/location_env_cfg.py - Get-up task → SMP task reward: uses SMP reward
src/smp/rl/tasks/getup/getup_env_cfg.py