SR-ARPOD/Plots/README.md
2026-04-01 22:48:53 +08:00

51 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# STELLAR 论文图表生成
本目录包含用于生成期刊论文图表的 Python 脚本。
## 快速开始
```bash
# 1. 解析训练日志 → CSV
python -m Plots.parse_training_logs
# 2. 运行模型评估 → .npz 轨迹数据
python -m Plots.run_evaluation --n_episodes 50
# 3. 生成全部图表
python -m Plots.generate_all --plot_only
# 或一键完成全部流程
python -m Plots.generate_all --full
```
## 图表清单
| 编号 | 文件 | 内容 | 数据来源 |
|------|------|------|----------|
| 图 1 | `fig1_training_curves.py` | 训练收敛(成功率、回报、熵、介入率) | CSV / TB CSV |
| 图 2 | `fig2_trajectory_3d.py` | 3D 轨迹 + 安全约束可视化 | `.npz` |
| 图 3 | `fig3_state_convergence.py` | 位置/速度时间历程 | `.npz` |
| 图 4 | `fig4_control_decomposition.py` | 控制分解u_nom, u_res, u_applied | `.npz` |
| 图 5 | `fig5_safety_analysis.py` | HOCBF 约束值 (h_c, h_a, h_) | `.npz` |
| 图 6 | `fig6_ablation.py` | 消融实验对比柱状图 | 消融评估 |
| 图 7 | `fig7_monte_carlo.py` | 蒙特卡洛统计(误差散点/分布/奖励) | `.npz` |
| 图 8 | `fig8_error_convergence.py` | 误差收敛包络 | `.npz` |
## 基础设施
- `plot_config.py` — 全局样式(字体、颜色、尺寸)
- `parse_training_logs.py` — 训练日志解析(多阶段文本 + TensorBoard
- `run_evaluation.py` — 模型评估与轨迹数据采集
- `generate_all.py` — 一键流水线
## 数据位置
- **训练日志**: `Logs/contv3_hybrid40h_v2_20260316_140251/train.log`
- **最佳检查点**: `Checkpoint/contv3_hybrid40h_v2_20260316_140251/phase2/best_model.pt`
- **TB 导出 CSV**: `Plots/tb_exports/tb_scalars_all.csv`
- **中间数据**: `Plots/data/` (解析后的 CSV 和评估 .npz)
## 输出格式
每张图同时输出 PDF矢量和 PNG300 dpi保存于 `Plots/` 根目录。