stable-baselines3

Train reinforcement learning agents in Stable Baselines3 with Gymnasium environments.

783|65|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill stable-baselines3-leonchaox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stable-baselines3
Source: https://github.com/LeonChaoX/qinyan-academic-skills/tree/main/skills/09-%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E4%B8%8E%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/stable-baselines3
Command: npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill stable-baselines3-leonchaox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Stable Baselines3 skills solve the problem of turning reinforcement learning ideas into working training pipelines by providing a reliable, unified way to train, evaluate, and iterate on RL agents.

Core Features & Use Cases

  • Unified RL training workflows: Train PPO/A2C for quick on-policy experiments, and SAC/TD3/DQN for sample-efficient learning in common action-space settings.
  • Gymnasium-compatible custom environments: Build environments that work with SB3, validate them with check_env, and handle observations/actions correctly (including image constraints).
  • Scalable training & monitoring: Use vectorized environments (Dummy/Subproc), callbacks (evaluation/checkpoint/early stopping), and model persistence for repeatable results.

Quick Start

Use the stable-baselines3 skill to train a PPO agent on a Gymnasium environment (e.g., CartPole) and save the resulting model for later evaluation.

Frequently Asked Questions about stable-baselines3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I train reinforcement learning agents with Stable Baselines3 and Gymnasium?

Validate custom Gymnasium environments for Stable Baselines3 training by using the check_env utility. This ensures your environment complies with required reset and step semantics for correct observation and action handling.

Can I use vectorized environments and callbacks for RL training automation?

Yes, you can use vectorized environments like Dummy or Subproc alongside callbacks for training automation. This enables scalable training with evaluation, checkpointing, and early stopping during reinforcement learning experiments.

Does Stable Baselines3 support both on-policy and off-policy reinforcement learning algorithms?

Stable Baselines3 supports on-policy algorithms like PPO and A2C for quick experiments, alongside off-policy algorithms like SAC, TD3, and DQN for sample-efficient learning across common action spaces.

What's the best way to handle model evaluation and checkpointing during RL training?

The best way to handle model evaluation and checkpointing during RL training is by implementing callbacks. This skill provides guidance on using evaluation and checkpoint callbacks to monitor progress and save models automatically.

Why do I need to match algorithm selection to my action space in Stable Baselines3?

Algorithm selection must match your action space in Stable Baselines3 because different algorithms handle discrete or continuous actions differently. Correct matching ensures sample-efficient learning and proper agent interaction within Gymnasium environments.