Skip to content

Commit 7803c9e

Browse files
committed
feat(cli): add headless training command
1 parent f5e4a38 commit 7803c9e

4 files changed

Lines changed: 524 additions & 29 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ bun run demo:drone
102102

103103
The `init:*` commands create template projects without running experiments. The `demo:*` commands create timestamped projects under `.ignitionrl/demos/` and write export artifacts under each project `exports/` directory.
104104
Existing projects can be inspected without rerunning experiments through `bun run --cwd packages/cli start inspect <projectDir> --json`.
105+
Registered environments can be trained without the demo shortcut through `bun run --cwd packages/cli start train <projectDir> <environmentId> --learner tabular-q --episodes 30 --checkpoint-id final --json`, which persists traces, metrics and a learner checkpoint.
105106
Persisted runs can be compared without rerunning experiments through `bun run --cwd packages/cli start compare <projectDir> --score-by summary.totalReward --json`.
106107
Metric series can be inspected through `bun run --cwd packages/cli start metrics <projectDir> totalReward --json`.
107108
The offline Studio bootstrap also embeds metric chart summaries for persisted metrics, so the future metrics panel can render chart selectors and latest values immediately.

‎packages/cli/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ bun run --cwd packages/cli start demo drone-target ./drone-target-demo.ignitionr
2424
--learner-episodes 12 \
2525
--inference-episodes 3
2626

27+
bun run --cwd packages/cli start train ./grid-world-project.ignitionrl GridWorld-v0 \
28+
--learner tabular-q \
29+
--episodes 30 \
30+
--checkpoint-id final \
31+
--json
32+
2733
bun run --cwd packages/cli start inspect ./target-2d-demo.ignitionrl \
2834
--score-by summary.totalReward \
2935
--json
@@ -124,6 +130,8 @@ If the project directory is omitted, the CLI creates a timestamped project under
124130

125131
Each demo command runs the environment, writes traces, metrics and learner checkpoints when available, then exports JSON artifacts under the project `exports/` directory. The DroneTarget demo also replays the final continuous-control checkpoint as a separate inference run so the learned policy is directly comparable and replayable.
126132

133+
`train` opens an existing local project, verifies that the selected environment is registered, runs one learner, and writes traces, metrics and a checkpoint. Supported first-class learner selections are `tabular-q` and `dqn` for `GridWorld-v0`/`Target2D-v0`, and `linear-policy-search` for `DroneTarget-v0`. Use `--json` for automation and `--checkpoint-id` to choose the checkpoint name.
134+
127135
- project report;
128136
- Studio project view;
129137
- Studio environment view when `environment --export` is used;

0 commit comments

Comments
 (0)