SB3 Trainer Project

Overview

  • Showcases how to orchestrate reinforcement-learning experiments with Stable Baselines3 (SB3) inside the AGILab framework.

  • Builds a DAG of training tasks (one per agent configuration) and executes them through the distributor so multiple policies can be trained in parallel.

  • Highlights how to persist trained artefacts and logs under save_uri so the Experiment and Explore pages can surface them.

Manager (sb3_trainer.sb3_trainer)

  • Accepts a list of agent definitions (policy name, hyperparameters) and turns them into a work plan consumed by WorkDispatcher.

  • Sets up output directories, handles archive unpacking and keeps the run graph serialised so the Workplan visualiser can display training dependencies.

  • Illustrates how to declare non-tabular workloads (function invocations instead of dataframe partitions).

Worker (sb3_trainer_worker.sb3_trainer_worker)

  • Executes the generated work plan, instantiates SB3 trainers per agent and persists checkpoints in the configured save_uri.

  • Includes pre/post-install scripts to fetch RL-specific assets (Gym wrappers, environments) and test harnesses to validate the training loop.

Assets & Tests

  • app_test.py verifies that trainer definitions stream correctly from app_settings.toml into the work plan.

  • src/sb3_trainer_worker/run-all-test.py exercises end-to-end training in a controlled environment.

  • src/app_settings.toml demonstrates how to describe multiple trainer variants in the AGILab configuration format.

API Reference

sb3 trainer package diagram sb3 trainer class diagram sb3 trainer worker package diagram sb3 trainer worker class diagram