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 ------------- .. image:: diagrams/packages_sb3_trainer.svg :width: 400 :alt: sb3 trainer package diagram :align: center .. automodule:: sb3_trainer.sb3_trainer :members: :undoc-members: :show-inheritance: .. image:: diagrams/classes_sb3_trainer.svg :width: 400 :alt: sb3 trainer class diagram :align: center .. image:: diagrams/packages_sb3_trainer_worker.svg :width: 400 :alt: sb3 trainer worker package diagram :align: center .. automodule:: sb3_trainer_worker.sb3_trainer_worker :members: :undoc-members: :show-inheritance: .. image:: diagrams/classes_sb3_trainer_worker.svg :width: 400 :alt: sb3 trainer worker class diagram :align: center