Repository navigation
RFC: Canonical Learning Families, Cross-Algorithm Compatibility Shim, and Benchmark Strategy (training/*)
#965
Replies: 1 comment
1.A.I would suggest not maintaining the old directories , just for backwards compatibility, I feel that goes against point 1. in the motivation. The field is moving fast, and the methods we have converge moderately quickly, the baselines we have right now are replaceable IMO. B.IL is a bit misleading label (as many other methods also supported are referred as imitation learning, I think behavioural_cloning, distillation (or perhaps less likely supervised_learning) would be better. I would suggest selecting frameworks that support SAC and PPO and TD (e.g. sb3, RSL-RL apart from td), and having one "pure" RL family, sharing e.g. dense and sparse reward functions, and if there are worthwhile examples then indeed having examples for each. I would similarly suggest merging world model families (and the related diff based approaches), and maintaining one example inside, either learned or analytical. I have a suspicion that the learned one would be more generally applicable to various tasks without tuning, but I might be wrong I support the idea of including ES methods, although perhaps that makes the "learning" folder a bit of a misnomer, and control might be better. Alternatively I would also be happy with having a tutorial instead for ES. C.Adversarial discrimination methods need to be integrated into the learning (simultaneous learning for them is usually important), so including an example of it in the learning is fine but I would suggest having it in the main myosuite package. The other two are sensible mechanisms that should be part of the package. 2.This makes me think ES would be better implemented as a standalone tutorial. 3.Maybe worth mentioning that new algo contribution PRs should not modify the core myosuite package by adding features specific to them. If a general improvement to myosuite is made during the development of the algo contribution, it should be separated and the PR should be able to stand on its own. 4.The number of tasks is relatively large, I think at least one of the hand tasks could be dropped, and locomotion could be one task with domain randomized terrain (in an ideal world with automatic domain randomization), and domain randomized fatigue level in a waypoint setting, that way a single training run can be used to characterise the agent instead of 3/4. Alternatively, I would also be happy with just a level ground straight walking instead as well, just want to reduce the future simulation burden. Q&A
|
Uh oh!
There was an error while loading. Please reload this page.
Context & Motivation
MyoSuite's
training/directory (training/supermimic/,training/dynsyn/,training/chasetag_teacher/, alongsidescripts/train_sb3.pyandscripts/train_mjlab.py) is growing as new RL, world-model, and biomechanical control methods appear. Building on #961, we want to align on a long-term structure so we avoid:myoElbowPose1D6MRandom-v0) rather than multi-DoF musculoskeletal tasks where algorithm choice meaningfully changes policy quality or training cost.This Discussion proposes four pieces for feedback:
SuperMimicandDynSynfit in),1. Canonical Learning Families vs. Composable Wrappers
A. Decomposing Composite Recipes (
supermimic,chasetag_teacher,dynsyn)Existing directories (
training/supermimic/,training/dynsyn/,training/chasetag_teacher/) keep their current paths so install URLs do not break, while new general-purpose trainers target generic paradigm-level directories (training/<family>/).Looking at
training/supermimic/specifically, it combines three distinct mechanisms:func.puretask observation/reward/termination heads, plus optional test-time gradient action refinement--refine),DAggerstudent distillation inchasetag_teacher).Each of those mechanisms is useful well beyond multi-clip motion mimicry if factored into clean, general families.
B. Candidate Canonical Families (
training/<family>/)training/ppo/(+ existingtrain_sb3/train_mjlab)PPO(RSL-RL/SB3, KL-adaptive schedules, asymmetric critic)512–4096envs) on smooth dense-reward control.training/sac/SAC(distributional twin critic + per-actuator entropy modulation + persistent exploration noise)HandReach,HandPose,Relocate,Baoding), contact-rich sparse+dense tasks (TableTennis), and moderate-env / sample-limited budgets.training/td3/TD3(FastTD3distributional twin critic + target policy smoothing)training/wm/(generalizingsupermimic)SuperMimic/TD-MPC2/Dreamer(learned dynamics + analytical kinematics/func.pureheads + imagined rollouts + test-time refinement)myoMimic-v0) and any task exposing differentiabletorchobservation/reward terms (func.pure).training/bptt/(candidate — see Open Questions)SHAC/APG(direct analytic gradients through short-horizon simulator/muscle rollouts + terminal value bootstrap)training/il/(generalizingchasetag_teacher)BC(MLP / Flow / Diffusion),DAgger, and offline pretraining fromcomputed_muscle_control(CMC,#644)ChaseTag), learning from human/mocap demonstrations, and warm-startingSAC/PPOfrom biomechanicalCMCmuscle excitations.training/es/(candidate — see Open Questions)CMA-ES/CEM/ARSover low-dimensional reflex or CPG controllers (Geyer & Herr lineage)Sarc/Fatigait adaptation.C. Composable Modules (Rather Than Separate Trainers)
Cross-cutting mechanisms that wrap an arbitrary policy or MDP should be reusable across families rather than forked per trainer:
myosuite.utils.action_map— e.g.,DynSyn, PCA/NMF, SAR): Trainable/playable acrossppo,sac,td3,il, oresvia a shared action-map contract recorded inmanifest.jsonand folded into.onnx.AMP/ASE): Composable reward module attachable to on- or off-policy RL.ChaseTag,TableTennis): Multi-agent rollout scheduling decoupled from the inner policy optimizer.2. Cross-Algorithm Compatibility Shim (3 Layers)
VecEnvShim(Simulation Rollout Adapter):rsl_rl,sb3,supermimic, and off-policy prototypes each wrapmake_env(..., backend="cpu"|"mjlab")separately, duplicating subtle logic (auto_reset=Falsepre-resetterminal_obscapture without buffer aliasing,time_outs = truncated & ~terminated,[0, 1]vs[-1, 1]action bounds, Dict observation groups vs flatfloat32tensors).VecEnvShimexposes one tensor rollout contract acrosscpu(sync/async) andmjlab, with optionalActionMapcomposition.EvalProtocol:training/<family>/(--env-id,--backend cpu|mjlab,--num-envs,--env-steps,--seed,--run-dir,--resume).summary.jsonand learning-curve logs (env_steps,train_wall_s,mean_return,final_solved_rate,any_step_solved_rate, task-specific metrics such asmpjpe_mm,steps_per_sec,peak_rss_mb/peak_cuda_mb,gpu_hours).PolicyBundleArtifact (.onnx+ Embedded Checkpoint +manifest.json):myosuite.utils.export_onnx.export_policy,bundle_onnx_with_checkpoint, andcheckpoint_manifest.write_manifest, every canonical trainer exports<run_dir>/model_final.onnxwith observation normalization, symmetry canonicalization, action scaling, and anyActionMapfolded into the graph, plus the compressed native checkpoint embedded in ONNX metadata.PolicyBundleruns zero-trainer playback inmyosuite(CPU,mjlab, C++, browser) and can serve directly as a frozen teacher intraining/il/(DAgger) or replay/actor warm-start intraining/sac/,training/td3/, andtraining/ppo/without cross-importingtraining/*packages.3. Contributor & Agent Rules for Algorithm Proposals
To keep
training/maintainable for both human contributors and AI coding agents:MyoHub/myosuite.training/<family>/):3+matched seeds, matchedenv_stepsand wall-clock/compute budgets on CPU andmjlabGPU) and demonstrate a clear, practical advantage overPPOon at least one realistic multi-DoF musculoskeletal task (minutes-to-hours regime): either achieving policy quality / solve ratesPPOfails to reach, or reaching target solve rates substantially faster (training/<family>/Trainer:env_idhardcoded hyperparameter lookup tables).prior <family>vsproposed <family>vsPPO(3+seeds), include a mechanism-level ablation showing which added component drives the gain, verify no regression on the family's target tasks, state checkpoint backward compatibility, and include permissive license/attribution notices (MIT/Apache-2.0/BSD).4. Multi-Regime Release Benchmarking (Future Release)
For a future release, we can separate fast CI/smoke sanity (e.g.,
myoElbowPose1D6MRandom-v0verifying contract parity and ONNX export in seconds) from a curated multi-regime benchmark matrix where each maintained family is evaluated on the musculoskeletal task categories it is meant for under realistic compute budgets:myoHandReachRandom-v0,myoHandPoseRandom-v0,myoChallengeRelocateP1-v0,myoChallengeBaodingP2-v1)myoChallengeTableTennisP1-v0,myoChallengeChaseTagFBP2-v0)myoLegRoughTerrainWalk-v0,myoSarcLegWalk-v0/myoFatiLegWalk-v0,myoFullBodyWaypoint-v0)myoMimic-v0train/held-out split)General model-free families (
ppo,sac,td3) would run across all regimes as common anchor curves (score/solved% vs env_stepsandvs GPU-minutes), while specialized families (wm,bptt,il,es) run on the regimes matching their assumptions, publishing version-pinnedPolicyBundleartifacts and a "Choosing a Learning Method" guide in the docs.Open Questions for Maintainers
ppo,sac,td3,wm(generalizingsupermimic's hybrid analytical + learned world model), andil(BC/DAgger/CMC-bootstrapped offline-to-online RL), should we also includebptt(short-horizon differentiable policy gradient) andes(evolutionary reflex/CPG optimization) as target canonical families, while treatingdynsyn, motion priors (AMP), and self-play pools as composable wrappers?VecEnvShim(terminal_obs,time_outs, exactaction_low/high, andActionMapcomposition acrosscpuandmjlab) live in coremyosuite/envs/(containing zero trainer/optimizer logic)?training-guidelines.md(wheremyoElbowPose1D6MRandom-v0is a sub-10s smoke check and two of the four tasks currently lackmjlabtwins ondev), and which flagship environments (existing or upcoming) should form the curated multi-regime release benchmark suite?#961now as the narrow naming/evolution rule and follow up once this Discussion converges, or fold the agreed shim and evidence gates directly into#961?All reactions