Agent skill · research science · aiskillstore
stable-baselines3
Production-ready reinforcement learning algorithms (PPO, SAC, DQN, TD3, DDPG, A2C) with scikit-learn-like API. Use for standard RL experiments, quick prototyping, and well-documented algorithm implementations. Best for single-agent RL with Gymnasium environments. For high-performance parallel training, multi-agent systems, or custom vectorized environments, use pufferlib instead.
Why this skill is useful
Provides specific implementation patterns and best practices for training reinforcement learning agents using Stable Baselines3 that the AI wouldn't reliably generate on its own.
What it needs
Requires gymnasium, torch installed locally. About 5k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Stable Baselines3 Overview Stable Baselines3 (SB3) is a PyTorch-based library providing reliable implementations of reinforcement learning algorithms. This skill provides comprehensive guidance for training RL agents, creating custom environments, implementing callbacks, and optimizing training workflows using SB3's unified API. Core Capabilities 1. Training RL Agents Basic Training Pattern: Important Notes: totaltimesteps is a lower bound; actual training may exceed this due to batch collection Use model.load() as a static method, not on an existing instance The replay buffer is NOT saved with the model to save space Algorithm Selection: Use references/algorithms.md for detailed algorithm characteristics and selection guidance. Quick reference: PPO/A2C: General-purpose, supports all action space types, good for multiprocessing SAC/TD3: Continuous control, off-policy, sample-efficient DQN: Discrete actions, off-policy HER: Goal-conditioned tasks See scripts/trainrlagent.py for a complete training template with best practices. 2. Custom Environments Requirements: Custom environments must inherit from gymnasium.Env and implement: init(): Define actionspace and observationspace reset(seed, options): Return initial observation and info dict step(action): Return observation, reward, terminated, truncated, info render(): Visualization (optional) close(): Cleanup resources Key Constraints: Image observations must be np.uint8 in range [0, 255] Use channel-first format when possible (channels, height, width) SB3 normalizes images automatically by dividing by 255 Set normalizeimages=False in policykwargs if pre-normalized SB3 does NOT support Discrete or MultiDiscrete spaces with start!=0 Validation: See scripts/customenvtemplate.py for a complete custom environment template and references/customenvironments.md for comprehensive guidance. 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/stable-baselines3--85fb35