CLI Reference

This document is a reference of all the CLI commands available. Note all the CLI arguments must follow strict hierarchy.

Note

The CLI has been built using click.

Usage: torchrl [OPTIONS] COMMAND [ARGS]...

  TorchRL CLI.

Options:
  --usr-dirs   Path to user module(s) which can register problems or hparams.
               Multiple uses of this flag are allowed. Optionally, use
               environment variable USR_DIRS separated by a ':'. e.g.
               USR_DIRS=/path/a:/path/b
  --help       Show this message and exit.

Commands:
  list    List Resources.
  resume  Resume an experiment from log directory.
  run     Run Experiments.

list

This sub-command is used to list registered HParams sets.

Usage: torchrl list [OPTIONS] COMMAND [ARGS]...

  List Resources.

Options:
  -o, --output [default|json|yaml]
                                  Output format.
  --help                          Show this message and exit.

Commands:
  hparams   List all registered hyper-parameter sets.
  problems  List all registered Problems with corresponding hyper-parameter...

Warning

Due to strict options ordering, --usr-dirs belong to the top level command. Hence, the correct usage is

torchrl --usr-dirs experiments list problems

run

This sub-command is used to run the actual experiments.

Usage: torchrl run [OPTIONS] <problem>

  Run Experiments.

  This initializes the Problem class with a given Hyperparameter Set. If the
  hyperparameter set is not provided, the first set from the list problem's
  hyperparam sets is used. Arbitrary key value pairs can be provided to
  extend the set from command line.

Options:
  --hparam-set                Hyperparameter set name. If not provided, first
                              associated used by default.
  --extra-hparams             Comma-separated list of extra key-value pairs.
  --seed                      Random Seed.
  --progress / --no-progress  Show/Hide epoch progress.
  --cuda / --no-cuda          Enable/Disable CUDA.
  --device                    Device selection.
  --log-dir                   Directory to store logs.
  --log-interval              Log interval w.r.t epochs.
  --eval-interval             Eval interval w.r.t epochs.
  --num-eval                  Number of evaluations.
  --checkpoint-prefix         Checkpoint file prefix.
  --help                      Show this message and exit.

resume

This sub-command is used to resume experiments from an experiment log directory.

Usage: torchrl resume [OPTIONS] <log_dir>

  Resume an experiment from log directory.

Options:
  --progress / --no-progress  Show/Hide epoch progress.
  --cuda / --no-cuda          Enable/Disable CUDA.
  --device                    Device selection.
  --start-epoch               Epoch to start with after a load.
  --log-interval              Log interval w.r.t epochs.
  --eval-interval             Eval interval w.r.t epochs.
  --num-eval                  Number of evaluations.
  --help                      Show this message and exit.