Skip to content

Train on the catalog cartpole

Every simulo create starter targets the same immutable global-catalog version, simulo/robot/cartpole:v1. This guide runs the training template end to end and explains what each part of the output means.

Terminal window
simulo create cartpole_demo --type training
cd cartpole_demo
simulo run app.py --num-envs 4096 --max-iterations 200

--num-envs and --max-iterations are this app’s own flags — the entrypoint’s default values, forwarded through simulo run. Raise --max-iterations for a longer, better-converged run; lower --num-envs for a faster, noisier one.

The log lines and result fields below are what a real run produces; the reward numbers are an illustrative example, not a measured benchmark — every training run lands somewhere different.

Following job <job-id> (--detach to submit without waiting)...
[train] iteration 1/200 ...
[train] Best checkpoint saved at iteration 150 (reward=289.42)
[train] iteration 200/200 ...
Terminal window
simulo result
{ "checkpoint": "/out/cartpole_demo_final.pt", "num_envs": 4096, "best_reward": 294.65, "iterations": 200 }

The scaffolded CartpoleDemoTask (in app.py) is worth reading end to end — it’s the shape every task follows, regardless of robot:

  • Observation (4-dim): pole angle, pole angular velocity, cart position, cart velocity.
  • Action (1-dim): a scaled horizontal force applied to the cart.
  • Reward: a weighted sum of “stayed alive”, a termination penalty, and penalties on pole angle, cart velocity, and pole velocity — the classic cartpole shaping, tunable via the rew_scale_* class attributes.
  • Termination: the cart leaving its track, or the pole falling past ±90°.

Training keeps two checkpoints: latest.pt (for resuming) and best.pt (the highest-reward policy seen so far, with a best.json sidecar recording when it was captured). The best checkpoint is often captured mid-run, not at the final iteration — a last-checkpoint-only workflow would lose it.

Terminal window
simulo models
NAME KIND SIZE SHA256 CREATED MODEL ID
latest.pt latest 2148728 b7e410c92a55 2026-07-10T18:05:02Z 51aa...
best.pt best 2148728 3f9c2ab81d04 2026-07-10T18:04:18Z 8c2f...

Full detail on downloading these: Retrieve and verify models.