Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

License

NotificationsYou must be signed in to change notification settings

kengz/SLM-Lab

Repository files navigation

Modular Deep Reinforcement Learning framework in PyTorch.
Companion library of the bookFoundations of Deep Reinforcement Learning.
Documentation ·Benchmark Results

NOTE: v5.0 updates to Gymnasium,uv tooling, and modern dependencies with ARM support - seeCHANGELOG.md.

Book readers:git checkout v4.1.1 forFoundations of Deep Reinforcement Learning code.

ppo beamriderppo breakoutppo kungfumasterppo mspacman
BeamRiderBreakoutKungFuMasterMsPacman
ppo pongppo qbertppo seaquestppo spaceinvaders
PongQbertSeaquestSp.Invaders
sac antsac halfcheetahsac hoppersac humanoid
AntHalfCheetahHopperHumanoid
sac doublependulumsac pendulumsac reachersac walker
Inv.DoublePendulumInvertedPendulumReacherWalker

SLM Lab is a software framework forreinforcement learning (RL) research and application in PyTorch. RL trains agents to make decisions by learning from trial and error—like teaching a robot to walk or an AI to play games.

What SLM Lab Offers

FeatureDescription
Ready-to-use algorithmsPPO, SAC, DQN, A2C, REINFORCE—validated on 70+ environments
Easy configurationJSON spec files fully define experiments—no code changes needed
ReproducibilityEvery run saves its spec + git SHA for exact reproduction
Automatic analysisTraining curves, metrics, and TensorBoard logging out of the box
Cloud integrationdstack for GPU training, HuggingFace for sharing results

Algorithms

AlgorithmTypeBest ForValidated Environments
REINFORCEOn-policyLearning/teachingClassic
SARSAOn-policyTabular-likeClassic
DQN/DDQN+PEROff-policyDiscrete actionsClassic, Box2D, Atari
A2COn-policyFast iterationClassic, Box2D, Atari
PPOOn-policyGeneral purposeClassic, Box2D, MuJoCo (11), Atari (54)
SACOff-policyContinuous controlClassic, Box2D, MuJoCo

SeeBenchmark Results for detailed performance data.

Environments

SLM Lab usesGymnasium (the maintained fork of OpenAI Gym):

CategoryExamplesDifficultyDocs
Classic ControlCartPole, Pendulum, AcrobotEasyGymnasium Classic
Box2DLunarLander, BipedalWalkerMediumGymnasium Box2D
MuJoCoHopper, HalfCheetah, HumanoidHardGymnasium MuJoCo
AtariBreakout, MsPacman, and 54 moreVariedALE

Any gymnasium-compatible environment works—just specify its name in the spec.

Quick Start

# Installuv syncuv tool install --editable.# Run demo (PPO CartPole)slm-lab run# PPO CartPoleslm-lab run --render# with visualization# Run custom experimentslm-lab run spec.json spec_name train# local trainingslm-lab run-remote spec.json spec_name train# cloud training (dstack)# Help (CLI uses Typer)slm-lab --help# list all commandsslm-lab run --help# options for run command# Troubleshoot: if slm-lab not found, use uv runuv run slm-lab run

Cloud Training (dstack)

Run experiments on cloud GPUs with automatic result sync to HuggingFace.

# Setupcp .env.example .env# Add HF_TOKENuv tool install dstack# Install dstack CLI# Configure dstack server - see https://dstack.ai/docs/quickstart# Run on cloudslm-lab run-remote spec.json spec_name train# CPU training (default)slm-lab run-remote spec.json spec_name search# CPU ASHA search (default)slm-lab run-remote --gpu spec.json spec_name train# GPU training (for image envs)# Sync resultsslm-lab pull spec_name# Download from HuggingFaceslm-lab list# List available experiments

Config options in.dstack/:run-gpu-train.yml,run-gpu-search.yml,run-cpu-train.yml,run-cpu-search.yml

Minimal Install (Orchestration Only)

For a lightweight box that only dispatches dstack runs, syncs results, and generates plots (no local ML training):

uv sync --no-default-groups# skip ML deps (torch, gymnasium, etc.)uv tool install dstackuv run --no-default-groups slm-lab run-remote spec.json spec_name trainuv run --no-default-groups slm-lab pull spec_nameuv run --no-default-groups slm-lab plot -f folder1,folder2

Citation

If you use SLM Lab in your research, please cite:

@misc{kenggraesser2017slmlab,author ={Keng, Wah Loon and Graesser, Laura},title ={SLM Lab},year ={2017},publisher ={GitHub},journal ={GitHub repository},howpublished ={\url{https://github.com/kengz/SLM-Lab}},}

License

MIT

About

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors19

Languages


[8]ページ先頭

©2009-2026 Movatter.jp