feat(rl): PPO training pipeline with smoke-train verification#6
Merged
Conversation
Adds a complete RL training stack built on Stable-Baselines3 + PyTorch: training/ train_ppo.py — SB3 PPO CLI entry point (SubprocVecEnv + VecNormalize) eval_policy.py — load checkpoint → deterministic evaluation metrics configs/ppo_hover.yaml — YAML hyperparameter config examples/ 07_rl_hover.py — end-to-end: train PPO 50k steps, eval, print RMSE 08_rl_vs_pid.py — head-to-head comparison vs cascaded PID on circular trajectory pyproject.toml [project.optional-dependencies] rl = [torch, stable-baselines3, gymnasium, tensorboard, pyyaml] rl-dev = [..., wandb, optuna, moviepy] .gitignore: added training/checkpoints/ and tb/ (TensorBoard logs) Smoke-train results: 50,000 timesteps, 2 envs, ~2000 fps, 25 s wall-clock Model saves + loads successfully via eval_policy Tests (tests/test_rl_training.py): Smoke-train 1000 steps + save/reload/predict Self-contained eval_policy test (tiny model → metrics dict) All guarded by @pytest.mark.skipif(not _HAS_SB3) Full suite: 92 tests passed (ruff clean).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M2b — RL Training Pipeline (COMPLETES M2)
New:
training/packagetrain_ppo.pyeval_policy.pypos_rmse,success_rate,crash_rate,mean_rewardconfigs/ppo_hover.yamlNew examples
examples/07_rl_hover.py— end-to-end: train PPO 50k steps, eval, print RMSEexamples/08_rl_vs_pid.py— head-to-head comparison vs cascaded PID on circular trajectorypyproject.toml — optional RL extras
Smoke-train verified ✅
training/checkpoints/final.zippython -m training.eval_policy --path training/checkpoints/final.ziploads + evaluatesTests — 2 new in
tests/test_rl_training.py@pytest.mark.skipif(not _HAS_SB3).gitignore
Added
training/checkpoints/andtb/(TensorBoard logs)M1 + M2 — COMPLETE 🎉
6 PRs, 35+ files, 2,000+ lines of code, 92 tests passing: