|
Download code/README.md from harryzhang1018/TestRandomization: direct link, hf CLI and curl.
- Browser
- Download file 4.81 kB
-
https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/README.md
- Command line
-
hf download hf://datasets/harryzhang1018/TestRandomization/code/README.md
-
curl -L -o README.md https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/README.md
4.81 kB
| # Reproducing the results of the paper | |
| This folder contains the code that produces the results of *Screening Ground Vehicle Controllers via Test | |
| Randomization: Sim2Real and Sim2Sim Studies*, with the small intermediate files and result records it needs. | |
| | Folder | Study | Details | | |
| |---|---|---| | |
| | [`case1/`](case1/README_case1.md) | Case 1: four path-following controllers on the 1/6-scale ART vehicle; Chrono digital twin versus 60 physical runs (Sim2Real) | [`case1/README_case1.md`](case1/README_case1.md) | | |
| | [`case2/`](case2/README_case2.md) | Case 2: PPO goal-reaching policies; reduced-order model (ROM) versus Chrono HMMWV (Sim2Sim) | [`case2/README_case2.md`](case2/README_case2.md) | | |
| ## Quick start: all tables from the released records (a few minutes, no simulation) | |
| ```bash | |
| # Case 1: Tables I, IV, V, sensitivity, pair tests, MPC failures (inputs in case1/data, about 10 s) | |
| cd case1 | |
| python3.12 -m venv .venv && .venv/bin/pip install -r requirements.txt | |
| PY=.venv/bin/python | |
| $PY analysis/baseline_orders.py data/per_start data/nominal_sim_runs.csv data/baseline_orders.json | |
| $PY analysis/case1_rank_analysis.py data/per_start data/physical_runs.csv data/baseline_orders.json results | |
| $PY mpc_failures/d3_range.py data/per_start data/b01_mpc_first_tick.csv \ | |
| results/mpc_failures.json results/mpc_failure_geometry.png | |
| cd .. | |
| # Case 2: Table VI and all Case 2 numbers (inputs in case2/results and case2/policies, under 2 min) | |
| cd case2 | |
| pip install -r requirements.txt | |
| python analyze.py --set A --pool explore | |
| python report_explore.py | |
| python analyze_confirm.py --set B --rom-dir results/rom_B_confirm16 --chrono-dir results/chrono_B_confirm16 \ | |
| --primary confirm --secondary confirm16 --out results/confirm_analysis.json | |
| python behavior_stats.py B confirm16 | |
| python posthoc_confirm.py | |
| python report_confirm.py | |
| python paper_numbers.py # prints every Case 2 number of the paper; writes results/paper_numbers.json | |
| ``` | |
| These commands overwrite the released outputs in `case1/results/` and `case2/results/` with identical files. | |
| Tables II and III (physical runs) are computed from the physical logs on GitHub (stage 2 of Case 1). The two | |
| case READMEs give the commands of every stage, their inputs, outputs, and runtimes. | |
| ## Where each result comes from | |
| | Paper item | Script | Output | | |
| |---|---|---| | |
| | Table I: TR results per offset range (S0-S4) | `case1/analysis/case1_rank_analysis.py` | `case1/results/case1_rank_analysis.json`: `offset_sweep` | | |
| | Tables II-III: physical runs and nominal simulation | `case1/physical/physical_runs.py` | `case1/results/tables_II_III.{tex,json}` | | |
| | Table IV: TR versus nominal simulation and Monte Carlo | `case1/analysis/baseline_orders.py`, `case1/analysis/case1_rank_analysis.py` | `case1_rank_analysis.json`: `method_comparison`, `physical_pairwise_tests` | | |
| | Table V: ablation by channel | `case1/analysis/case1_rank_analysis.py` | `case1_rank_analysis.json`: `ablation_by_channel` | | |
| | Case 1 sensitivity (tube, horizon, number of starts) and Hoeffding bound | `case1/analysis/case1_rank_analysis.py` | `case1_rank_analysis.json`: `tube_horizon_sensitivity`, `trial_number_sensitivity`, `hoeffding` | | |
| | MPC failures from large heading errors | `case1/mpc_failures/d3_range.py` | `case1/results/mpc_failures.json` | | |
| | Case 2 design exploration (goal set A) | `case2/analyze.py`, `case2/report_explore.py` | `case2/results/exploration_tau_table.json`, `exploration_report.md` | | |
| | Table VI and the Case 2 held-out results | `case2/analyze_confirm.py`, `case2/posthoc_confirm.py`, `case2/behavior_stats.py` | `case2/results/confirm_analysis.json`, `posthoc_confirm.json`, `behavior_B_confirm16.json`; all numbers in `paper_numbers.json` | | |
| The two case READMEs map every number in the text to its output key. | |
| ## Regenerating the records | |
| The quick start uses the released intermediate files. To regenerate them: | |
| - **Case 1 simulation logs:** the runner (`case1/runner/`) runs inside the Docker image named in | |
| `case1/README_case1.md`. The logs that it produced are in `simulation_logs/` of this dataset; stage 1 | |
| (`case1/extract/`) turns them into the per-episode tables of `case1/data/per_start/`. | |
| - **Case 1 physical runs:** folder `2024/PathFollowingSim2real/TestingData` of | |
| <https://github.com/uwsbel/sbel-reproducibility>. | |
| - **Case 2:** `case2/train_all.sh` trains the 24 policies (about 50 min each on one CPU core); `run_rom.py` and | |
| `chrono_runner.py` re-run the ROM and Chrono evaluations (PyChrono). The released policies and records make | |
| retraining unnecessary for checking the results. | |
| ## Licenses | |
| Code in this folder and the four checkpoints in `case2/policies/released/` are under the BSD 3-Clause license of | |
| the original repository (`case2/policies/released/LICENSE`). Data and result records are under CC BY 4.0. | |