How google-deepmind/bsuite works
Project type and purpose
• This is an open-source Python library (“bsuite”) providing
a suite of reinforcement-learning benchmarks, automated logging,
baseline agent implementations, and analysis/report generation.
• Its goal is to let researchers plug in any RL agent, run a
standardized collection of experiments, record results in CSV
or SQLite, then analyze performance via Jupyter notebooks or
LaTeX reports.
File structure
• Top-level components:
• bsuite/ (core library package)
– __init__.py, _metadata.py, bsuite.py (API entrypoints)
– environments/ (DM-Env style environments + tests)
– experiments/ (experiment definitions: env config, sweeps, analysis)
– baselines/ (reference agents in JAX, TF, random, third-party; each with run scripts)
– logging/ (CSV, SQLite, terminal logging implementations + tests)
– utils/ (helpers: dataset loaders, gym_wrapper, plotting, wrappers)
– analysis/ (results Jupyter notebook)
– sweep.py (high-level CLI to run entire suite)
– tests/ (unit tests)
• reports/ (LaTeX templates and images for conference reports)
• run_on_gcp.sh (GCP orchestration script)
• setup.py (packaging)
• .github/workflows (CI/CD)
• CONTRIBUTING.md, LICENSE, README.md (project metadata)
README for additional insights
• Core API functions: load_from_id, load_and_record_to_csv/sqlite/terminal
• A plugin-style pattern: experiments define SETTINGS sweeps + analysis.py
• Baseline run scripts accept --bsuite_id flags and multi-process pooling
• Analysis notebook reads logged data & generates radar plots, tables
• Reporting tools produce TeX files for ICLR/ICML/NeurIPS appendices
Detail
• Sub-system, its entrypoints, and its outputs.
• Plugin interfaces (e.g., sweep.SWEEP constant → experiment sweep loop).
• Test modules as part of CI pipeline.