stable-baselines3

Trains and evaluates RL agents with Stable Baselines3 on Gymnasium tasks.

33.0k|3.2k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill stable-baselines3-k-dense-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stable-baselines3
Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/scientific-skills/stable-baselines3
Command: npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill stable-baselines3-k-dense-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gymnasium, stable-baselines3, numpy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

SB3 provides production-ready reinforcement learning algorithms with a unified API, enabling rapid development, training, and evaluation of agents across Gymnasium environments.

Core Features & Use Cases

  • Unified API for PPO, SAC, DQN, TD3, A2C with Gymnasium support.
  • Vectorized environments, callbacks, evaluation workflows, and model persistence for scalable experiments.
  • Guidance and templates for custom environments, monitoring, and performance optimization in research and production.

Quick Start

Install the package, set up a Gymnasium environment, and train an agent using PPO with Stable Baselines3.

Frequently Asked Questions about stable-baselines3

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

FAQPage Schema
How do I train a reinforcement learning agent with PPO in Gymnasium?

Train a reinforcement learning agent with PPO by setting up a Gymnasium-compatible environment, selecting the PPO algorithm from Stable Baselines3, and calling the unified train API to begin optimization. This Skill provides templates that streamline the entire training workflow from environment initialization through model persistence.

What algorithms does Stable Baselines3 support for reinforcement learning?

Stable Baselines3 supports PPO, SAC, TD3, DQN, and A2C algorithms for reinforcement learning, all accessible through a unified API compatible with Gymnasium environments. Each algorithm implementation is production-ready and supports vectorized environments for scalable experimentation.

Can I use vectorized environments to parallelize reinforcement learning training?

Vectorized environments enable parallel reinforcement learning training by running multiple environment instances simultaneously through Stable Baselines3, significantly improving sample throughput and training efficiency. This Skill provides guidance and templates for configuring both parallel and single-agent setups.

How do I evaluate a trained RL agent across Gymnasium environments?

Evaluate a trained RL agent across Gymnasium environments using Stable Baselines3's built-in evaluation workflows, which provide standardized performance metrics and support callbacks for monitoring during evaluation. The Skill includes templates for evaluation and experimentation to ensure consistent assessment.

Do I need Gymnasium installed to use Stable Baselines3 algorithms?

Gymnasium is a required dependency for Stable Baselines3 algorithms, as the framework enforces Gymnasium compatibility for all environment interfaces and task definitions. You also need NumPy installed for array operations supporting training and evaluation workflows.

How do I save and load trained reinforcement learning models with SB3?

Save and load trained reinforcement learning models using Stable Baselines3's model persistence functionality, which allows storing trained agents and reloading them for continued training or deployment. This Skill covers model persistence alongside callbacks and monitoring for complete experiment management.