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.
npx skills add LeonChaoX/qinyan-academic-skills --skill stable-baselines3 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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:** ```python import gymnasium as gym from stable_baselines3 import PPO # Create environment env = gym.make("CartPole-v1") # Initialize agent model = PPO("MlpPolicy", env, verbose=1) # Train the agent model.learn(total_timesteps=10000) # Save the model model.save("ppo_cartpole") # Load the model (without prior instantiation) model = PPO.load("ppo_cartpole", env=env) ``` **Important Notes:** - `total_timesteps` 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, suppor
- Overview
- Core Capabilities
- 1. Training RL Agents
- 2. Custom Environments
- 3. Vectorized Environments
- 4. Callbacks for Monitoring and Control
- 5. Model Persistence and Inspection
- 6. Evaluation and Recording
- 7. Advanced Features
- Workflow Guidance
- Resources
- scripts/
- references/
- Installation
Basic installation uv pip install stable-baselines3 With extra dependencies (Tensorboard, etc.) uv pip install stable-baselines3[extra]
What does the stable-baselines3 skill do?
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.
How do I install it?
Run `npx skills add LeonChaoX/qinyan-academic-skills --skill stable-baselines3 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From LeonChaoX/qinyan-academic-skills, a repository with 759 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
