RL CLI Helpers (API) #
TorchLean's runnable RL examples (NN/Examples/Models/RL/*) share one CLI shape:
--updates <n>: how many update iterations to run,--eval-every <n>: evaluate everynupdates,--eval-episodes <n>: number of evaluation episodes per checkpoint,--eval-max-steps <n>: max steps per evaluation episode,--log <path|off|none|false>: where to write the widget-friendly TrainLog JSON.
This module centralizes that parsing so we don't duplicate the same flag boilerplate across CartPole/Pong/GridWorld examples.
Parsed PPO-style training flags shared by multiple runnable examples.
- updates : ℕ
- evalEvery : ℕ
- evalEpisodes : ℕ
- evalMaxSteps : ℕ
- logPath : System.FilePath
Instances For
def
NN.API.rl.cli.parsePpoFlags
(exeName : String)
(args : List String)
(defaultLogPath : System.FilePath)
(defaultUpdates defaultEvalEvery defaultEvalEpisodes defaultEvalMaxSteps : ℕ)
:
Parse PPO-style shared flags.
Notes:
--log off|none|falsedisables writing the JSON artifact but still returns the resolved defaultlogPath(useful for printing consistent banners).- We treat
0as invalid for the update/eval counts because a “no-op” run usually indicates a CLI mistake.