Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

srb agent learn — Learn from Demonstrations

Train offline on srb agent collect data without Isaac Sim, for faster startup and lower resource use.

Usage

srb agent learn --algo ALGO --env ENV_ID [options]

Options

OptionDescriptionDefault
-e/--env/--task ENVEnvironment ID for logs/specsREQUIRED
--cfg PATHYAML whose agent section overrides the algorithm configDEFAULT (none)
--algo ALGOImitation-learning algorithmREQUIRED
--dataset PATHOptional HDF5 demos; omission searches new run directory, errors if noneNone
--num_epochs NEpoch countAlgo default
--normalize_actionsNormalize dataset actionsFalse
--logdir/--logsOutput rootlogs/ at checkout root or current directory when installed

Trailing agent.KEY=VALUE overrides apply after --cfg, for example agent.train.batch_size=16; other overrides and arguments after -- are rejected.

Dataset admission and normalization

Training uses verified private HDF5 copies until workers, handles, and logging close; source changes cannot affect training. Config keeps the source path for provenance, not as an archive.

Admission rejects demos if declared num_samples differs from the actions or any selected per-step dataset length. Every configured filter key must name a dataset under the HDF5 mask/ group; an empty mask fails with the filter key. When all three arrays exist, dones must equal terminated OR truncated. Empty validation (split 1.0, or one demo with any positive split) requires agent.experiment.validate=false and agent.train.hdf5_validation_filter_key=null.

Cache, sequence, batch, and worker allocations share a 16 GiB ceiling. Arrays also have byte and element limits; excess declarations fail before payload reads. Retained metadata is capped at 128 MiB. Limits cover dataset allocations, not total process, model, optimizer, or device memory. Native configs can use custom action keys without unused SRB transition fields.

--normalize_actions globally scalar-normalizes a private copy in a Linux worker (2 GiB address space, 16 GiB output, 120 seconds); native_limits=Hdf5NativeLimits(...) can lower these limits. Source stays unchanged; training readmits transformed input and drops lossy scale-offset compression. normalization_params.txt records the range unless actions are constant or absent. Standalone normalization publishes files atomically one at a time; failure restores the previous pair. RobomimicNormalizationCleanupError.retry_cleanup() retries failed cleanup.

Supported Algorithms

Offline learning uses robomimic.

AlgorithmDescription
robomimic_bcBehavioral Cloning (MLP)
robomimic_bc_rnnBC with RNN policy
robomimic_bc_transformerBC with Transformer policy
robomimic_bcqBatch-Constrained Q-Learning
robomimic_cqlConservative Q-Learning
robomimic_iqlImplicit Q-Learning
robomimic_td3_bcTD3 with BC regularization
robomimic_glGoal-conditioned learning
robomimic_hbcHierarchical BC
robomimic_irisIRIS (latent skill discovery)
robomimic_diffusion_policyDiffusion Policy

See Robomimic algorithm documentation for hyperparameters.

Note: hyperparams/robomimic/bcq.json and iris.json disable VAE/GMM action samplers and the distributional critic. BCQ and IRIS’s BCQ value component requires at least one enabled. Training rejects these profiles before data access. Enable one (Robomimic default: action_sampler.vae.enabled=true) to use either algorithm.

Examples

srb agent learn --algo robomimic_bc --env peg_in_hole \
  --dataset logs/peg_in_hole/collect/<run>/datasets/demos_<timestamp>.hdf5
srb agent learn --algo robomimic_bc_rnn --env peg_in_hole \
  --dataset /path/to/demos.hdf5 --num_epochs 500

Output

Checkpoints and metrics go to <logdir>/<env_id>/<algo>/<timestamp>/. Evaluate:

srb agent eval --algo robomimic_bc --env peg_in_hole

Collect more demonstrations:

srb agent collect --algo robomimic_bc --env peg_in_hole --num_episodes 200

--model-artifact-output OUT packages the run as an SRB model artifact; the other --model-artifact-* options match srb agent train. --dataset records training-data provenance unless artifact dataset options override it.

See Also