Files
Robot_Arm/ml/gen/README.md
T

28 lines
1.3 KiB
Markdown
Raw 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.
# ml/gen — M1 离线数据生成(在高性能机器上跑)
依赖:Node ≥ 18,仓库根目录执行。输出写到 `ml/data/`(已 gitignore)。
## 1. 老师一致性门禁(先跑,决定是否需要共识过滤)
```
node ml/gen/consistency.cjs 300 4242 > ml/data/consistency.json
```
单核约 25–30 分钟(300 任务 × 6 次老师求解)。看 `consistentByGateRule`(pos 任务忽略 J6):
- ≥ 0.90 → 生成时不加 `--consensus`
- < 0.90 → 生成时加 `--consensus 4`(过滤与邻居绕法不一致的样本)
## 2. 生成数据
```
bash ml/gen/run_parallel.sh <每进程条数> <进程数> [起始种子] [额外参数]
# 例:16 核、5 万条、不共识:
bash ml/gen/run_parallel.sh 3125 16
# 例:16 核、5 万条、共识 4 邻居:
bash ml/gen/run_parallel.sh 3125 16 1 "--consensus 4"
```
耗时估算(沙箱实测每条每核约 2.1 s;高性能 CPU 单核通常快 1.5–2 倍):
- 不共识:约 30 核·时 → 16 核约 1–2 小时
- 共识 4:约 150 核·时 → 16 核约 5–9 小时
## 3. 回传给我
- `ml/data/stats.json`、`ml/data/consistency.json`(必须)
- `ml/data/shard_*.jsonl`(训练数据,体积约 2.8 MB/500 条 → 5 万条约 280 MB,可压缩后放网盘或直接留在本机用于 M3/M5)