AgileRL Training Workflows
Use this sub-skill for AgileRL classical single-agent RL training with Gymnasium environments: PPO on-policy, DQN/RainbowDQN/DDPG/TD3 off-policy, recurrent variants, population setup, replay or rollout buffers, and safe pre-flight checks before long runs.
Read First
references/workflows.md for on-policy/off-policy training recipes and population flow.
references/api-reference.md for important training helper and buffer APIs.
references/configuration.md for INIT_HP, net_config, YAML, logging, and environment patterns.
references/distributed-training.md for Accelerate/distributed constraints.
references/troubleshooting.md for shape, dependency, vector-env, W&B, and runtime failures.
scripts/agilerl_classic_smoke.py --help for a no-training import/config probe.
Route Within AgileRL
| Need |
Route |
| Evolution/tournament/mutation configuration |
../hpo-and-mutation/SKILL.md |
Custom net_config, EvolvableNetwork, CNN/LSTM/MultiInput setup |
../evolvable-modules/SKILL.md |
| Multi-agent PettingZoo training |
../multi-agent-and-wrappers/SKILL.md |
| Offline datasets or contextual bandits |
../offline-bandits-data/SKILL.md |
| LLM fine-tuning |
../llm-fine-tuning/SKILL.md |
Standard Classical Training Flow
- Install AgileRL and verify imports; use the root
scripts/check_agilerl_install.py if unsure.
- Create or wrap a Gymnasium environment; prefer
make_vect_envs(env_name, num_envs=...) for vectorized classical training.
- Define
INIT_HP with algorithm-specific keys and POP_SIZE.
- Define
net_config with encoder_config and head_config unless the default network is sufficient.
- Create a population with
create_population(algo=..., observation_space=..., action_space=..., net_config=..., INIT_HP=..., population_size=..., num_envs=..., device=...).
- For off-policy algorithms, create
ReplayBuffer; for on-policy PPO, use rollout collection/training helpers rather than replay memory.
- Configure
TournamentSelection and Mutations in the HPO sub-skill.
- Call
train_on_policy(...) or train_off_policy(...), or implement a custom loop following references/workflows.md.
Algorithm Selection
- Use
PPO for on-policy, stable policy-gradient workflows and recurrent PPO variants.
- Use
DQN or RainbowDQN for discrete-action off-policy value learning.
- Use
DDPG or TD3 for continuous-action off-policy actor-critic workflows.
- Use
train_on_policy for PPO and train_off_policy for DQN/RainbowDQN/DDPG/TD3 families.
Safe Validation
Run a smoke check before training:
python scripts/agilerl_classic_smoke.py --algorithm DQN --env CartPole-v1
python scripts/agilerl_classic_smoke.py --algorithm PPO --env CartPole-v1
The helper checks imports, Gymnasium spaces, basic config shape, and algorithm family routing. It does not train or download anything.
1---2name: training-workflows3description: "Use AgileRL classical single-agent training workflows for4 Gymnasium PPO, DQN, RainbowDQN, DDPG, TD3, replay/rollout buffers, and5 distributed training setup."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/training-workflows9 disco-role: operating10license: Apache 2.011---1213# AgileRL Training Workflows1415Use this sub-skill for AgileRL classical single-agent RL training with Gymnasium environments: PPO on-policy, DQN/RainbowDQN/DDPG/TD3 off-policy, recurrent variants, population setup, replay or rollout buffers, and safe pre-flight checks before long runs.1617## Read First1819- `references/workflows.md` for on-policy/off-policy training recipes and population flow.20- `references/api-reference.md` for important training helper and buffer APIs.21- `references/configuration.md` for `INIT_HP`, `net_config`, YAML, logging, and environment patterns.22- `references/distributed-training.md` for Accelerate/distributed constraints.23- `references/troubleshooting.md` for shape, dependency, vector-env, W&B, and runtime failures.24- `scripts/agilerl_classic_smoke.py --help` for a no-training import/config probe.2526## Route Within AgileRL2728| Need | Route |29| --- | --- |30| Evolution/tournament/mutation configuration | `../hpo-and-mutation/SKILL.md` |31| Custom `net_config`, `EvolvableNetwork`, CNN/LSTM/MultiInput setup | `../evolvable-modules/SKILL.md` |32| Multi-agent PettingZoo training | `../multi-agent-and-wrappers/SKILL.md` |33| Offline datasets or contextual bandits | `../offline-bandits-data/SKILL.md` |34| LLM fine-tuning | `../llm-fine-tuning/SKILL.md` |3536## Standard Classical Training Flow37381. Install AgileRL and verify imports; use the root `scripts/check_agilerl_install.py` if unsure.392. Create or wrap a Gymnasium environment; prefer `make_vect_envs(env_name, num_envs=...)` for vectorized classical training.403. Define `INIT_HP` with algorithm-specific keys and `POP_SIZE`.414. Define `net_config` with `encoder_config` and `head_config` unless the default network is sufficient.425. Create a population with `create_population(algo=..., observation_space=..., action_space=..., net_config=..., INIT_HP=..., population_size=..., num_envs=..., device=...)`.436. For off-policy algorithms, create `ReplayBuffer`; for on-policy PPO, use rollout collection/training helpers rather than replay memory.447. Configure `TournamentSelection` and `Mutations` in the HPO sub-skill.458. Call `train_on_policy(...)` or `train_off_policy(...)`, or implement a custom loop following `references/workflows.md`.4647## Algorithm Selection4849- Use `PPO` for on-policy, stable policy-gradient workflows and recurrent PPO variants.50- Use `DQN` or `RainbowDQN` for discrete-action off-policy value learning.51- Use `DDPG` or `TD3` for continuous-action off-policy actor-critic workflows.52- Use `train_on_policy` for PPO and `train_off_policy` for DQN/RainbowDQN/DDPG/TD3 families.5354## Safe Validation5556Run a smoke check before training:5758```bash59python scripts/agilerl_classic_smoke.py --algorithm DQN --env CartPole-v160python scripts/agilerl_classic_smoke.py --algorithm PPO --env CartPole-v161```6263The helper checks imports, Gymnasium spaces, basic config shape, and algorithm family routing. It does not train or download anything.