Datasets:
Tasks:
Reinforcement Learning
Modalities:
Image
Formats:
imagefolder
Languages:
English
Size:
1K - 10K
License:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SLM Lab <br>  
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
<p align="center">
|
| 5 |
+
<i>Modular Deep Reinforcement Learning framework in PyTorch.</i>
|
| 6 |
+
<br><br>
|
| 7 |
+
<a href="docs/BENCHMARKS.md"><b>Benchmark Results</b></a> · <a href="https://slm-lab.gitbook.io/slm-lab/">Documentation</a> · <a href="CHANGELOG.md">Changelog</a>
|
| 8 |
+
<br><br>
|
| 9 |
+
</p>
|
| 10 |
+
|
| 11 |
+
>**NOTE:** v5.0 updates to Gymnasium, `uv` tooling, and modern dependencies with ARM support - see [CHANGELOG.md](CHANGELOG.md).
|
| 12 |
+
>
|
| 13 |
+
>Book readers: `git checkout v4.1.1` for *Foundations of Deep Reinforcement Learning* code.
|
| 14 |
+
|
| 15 |
+
|||||
|
| 16 |
+
|:---:|:---:|:---:|:---:|
|
| 17 |
+
|  |  |  |  |
|
| 18 |
+
| BeamRider | Breakout | KungFuMaster | MsPacman |
|
| 19 |
+
|  |  |  |  |
|
| 20 |
+
| Pong | Qbert | Seaquest | Sp.Invaders |
|
| 21 |
+
|  |  |  |  |
|
| 22 |
+
| Ant | HalfCheetah | Hopper | Humanoid |
|
| 23 |
+
|  |  |  |  |
|
| 24 |
+
| Inv.DoublePendulum | InvertedPendulum | Reacher | Walker |
|
| 25 |
+
|
| 26 |
+
## Quick Start
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
# Install
|
| 30 |
+
uv sync
|
| 31 |
+
uv tool install --editable .
|
| 32 |
+
|
| 33 |
+
# Run demo (PPO CartPole)
|
| 34 |
+
slm-lab run # PPO CartPole
|
| 35 |
+
slm-lab run --render # with visualization
|
| 36 |
+
|
| 37 |
+
# Run custom experiment
|
| 38 |
+
slm-lab run spec.json spec_name train # local training
|
| 39 |
+
slm-lab run-remote spec.json spec_name train # cloud training (dstack)
|
| 40 |
+
|
| 41 |
+
# Help (CLI uses Typer)
|
| 42 |
+
slm-lab --help # list all commands
|
| 43 |
+
slm-lab run --help # options for run command
|
| 44 |
+
|
| 45 |
+
# Troubleshoot: if slm-lab not found, use uv run
|
| 46 |
+
uv run slm-lab run
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## Features
|
| 50 |
+
|
| 51 |
+
- **Algorithms**: DQN, DDQN+PER, A2C, PPO, SAC and variants
|
| 52 |
+
- **Environments**: Gymnasium (Atari, MuJoCo, Box2D)
|
| 53 |
+
- **Networks**: MLP, ConvNet, RNN with flexible architectures
|
| 54 |
+
- **Hyperparameter Search**: ASHA scheduler with Ray Tune
|
| 55 |
+
- **Cloud Training**: dstack integration with auto HuggingFace sync
|
| 56 |
+
|
| 57 |
+
## Cloud Training (dstack)
|
| 58 |
+
|
| 59 |
+
Run experiments on cloud GPUs with automatic result sync to HuggingFace.
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
# Setup
|
| 63 |
+
cp .env.example .env # Add HF_TOKEN
|
| 64 |
+
uv tool install dstack # Install dstack CLI
|
| 65 |
+
# Configure dstack server - see https://dstack.ai/docs/quickstart
|
| 66 |
+
|
| 67 |
+
# Run on cloud
|
| 68 |
+
slm-lab run-remote spec.json spec_name train # CPU training (default)
|
| 69 |
+
slm-lab run-remote spec.json spec_name search # CPU ASHA search (default)
|
| 70 |
+
slm-lab run-remote --gpu spec.json spec_name train # GPU training (for image envs)
|
| 71 |
+
|
| 72 |
+
# Sync results
|
| 73 |
+
slm-lab pull spec_name # Download from HuggingFace
|
| 74 |
+
slm-lab list # List available experiments
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
Config options in `.dstack/`: `run-gpu-train.yml`, `run-gpu-search.yml`, `run-cpu-train.yml`, `run-cpu-search.yml`
|
| 78 |
+
|
| 79 |
+
### Minimal Install (Orchestration Only)
|
| 80 |
+
|
| 81 |
+
For a lightweight box that only dispatches dstack runs, syncs results, and generates plots (no local ML training):
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
uv sync --no-default-groups
|
| 85 |
+
uv run --no-default-groups slm-lab run-remote spec.json spec_name train
|
| 86 |
+
uv run --no-default-groups slm-lab pull spec_name
|
| 87 |
+
uv run --no-default-groups slm-lab plot -f folder1,folder2
|
| 88 |
+
```
|
| 89 |
+
|