Skip to content

About

Interactive web interface for exploring simple reinforcement learning algorithms.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AI Service Center Berlin-Brandenburg and BMFTR logos

Workshop: Reinforcement Learning I - Introduction

This repository contains the material used in the introductory reinforcement learning workshop by the AI Service Center Berlin Brandenburg. It provides RL Lab, an educational interface for building intuition about reinforcement learning fundamentals.

Application Screenshot

Features

  • Environments:
  • Algorithms:
    • Q-Learning (custom build) — FrozenLake (tabular; discrete states only)
    • DQN (stable-baselines3) — all four environments; on FrozenLake the network's Q-values are rendered as the familiar Q-table
    • PPO (stable-baselines3) — CartPole, plus MountainCar as a deliberate failure demo (on-policy learning starves on sparse rewards)
  • Workshop features: live training charts, greedy policy playback with action overlay, 100-episode policy evaluation with confidence interval, sticky seeds for reproducible runs, per-environment tuned defaults, optimistic/pessimistic value initialization (DQN) to explore the exploration-exploitation tradeoff

Setup and Installation

Prerequisites

  • Git
  • Docker (Docker Desktop on Windows/macOS, Docker Desktop or Engine on Linux)
  • Hardware: ~1.5 GB disk for the images, 8 GB RAM recommended (4 GB minimum). Any modern Intel/AMD or Apple Silicon CPU — no GPU needed.

Python and UV is only needed for the optional homework notebooks, see examples/.

Quick Start (Experienced Users)

Already have git installed and Docker running? Get started in 4 commands:

  1. Clone the repository
git clone https://github.com/aihpi/workshop-rl1-introduction.git
  1. Navigate inside
cd workshop-rl1-introduction
  1. Is Docker running? Then pull the latest images and start the app (detached mode)
docker compose pull
docker compose up -d
  1. Open browser to http://localhost:3030

Remote machine? RL Lab also works when the containers run on another computer (a lab server, a VM): open http://<server-address>:3030 - the browser talks only to that one address, everything else is proxied inside.

Installation Guides (Beginners)

New to programming or Docker? Follow the more detailed installation guides:

📱 Windows

Windows Installation Guide

🍎 macOS

macOS Installation Guide

🐧 Linux

Linux Installation Guide

User Guide

Using the Tool

  1. Open the application in your browser at http://localhost:3030

  2. Pick an environment and an algorithm — the algorithm list only offers compatible choices. Info panels explain both.

  3. Adjust parameters using the sliders (the set depends on the algorithm), e.g.:

    • Training budget: episodes (Q-Learning) or timesteps (DQN/PPO)
    • Learning Rate (α): How fast the agent learns
    • Discount Factor (γ): Importance of future rewards
    • Exploration (ε): fixed rate (Q-Learning) or decay schedule (DQN)
    • Seed: every run is reproducible; the dice draws a new one
  4. Start training: Click "Start Training" and watch real-time visualizations:

    • Environment viewer: Renders the end of training episodes as they happen
    • Training progress: return, episode length and exploration charts
    • Policy: Q-Table: the learned action values on FrozenLake (Q-Learning's table, or the DQN network read out state by state)
  5. Play policy: Click "Play Policy" to watch the greedy policy step-by-step, with the chosen action overlaid. This also works before training — useful to show what a random/untrained policy does.

  6. Evaluate policy: Runs 100 greedy episodes and reports the mean return with a 95% confidence interval, against the environment's "solved" threshold.

Finished early? Want to dig deeper at home?

RL Lab shows what the algorithms do — two small Jupyter notebooks in examples/ show the code that does it. They are minimal and link to the official Gymnasium and Stable-Baselines3 documentation wherever you want more depth:

  • frozenlake_q_learning.ipynb — implement the Q-learning update rule yourself, train it on an 8×8 map and watch your own agent play.
  • sb3_quickstart.ipynb — the ~15 lines of Stable-Baselines3 code behind RL Lab's DQN and PPO: the evaluate → train → evaluate workflow with the same tuned hyperparameters, plus two exercises (why MountainCar needs its own settings; swapping DQN for PPO).

Solutions are included. One-time setup: examples/README.md.

Notebook Screenshot

Repository Structure

workshop-rl1-introduction/
├── backend/               # Python Flask backend
│   ├── algorithms/        # RL algorithm implementations
│   │   ├── base_algorithm.py      # Abstract base class
│   │   ├── q_learning.py          # Q-Learning (custom, tabular)
│   │   ├── sb3_base.py            # Shared stable-baselines3 wrapper
│   │   ├── dqn.py                 # DQN (stable-baselines3)
│   │   └── ppo.py                 # PPO (stable-baselines3)
│   ├── environments/      # Gymnasium environment handling
│   ├── training/          # Session management
│   ├── tests/             # Backend test suite
│   └── app.py             # Flask API server
├── frontend/              # React frontend
│   ├── src/
│   │   ├── components/    # React components (parameters, viewer, charts,
│   │   │                  # info panels, Q-table & evaluation visualizations)
│   │   ├── content/       # Environment & algorithm texts (About panels)
│   │   ├── App.js         # Main application
│   │   └── api.js         # Backend communication
│   └── src/components/__tests__/  # Frontend test suite
├── examples/              # Optional homework notebooks (+ solutions)
│   ├── notebooks/
│   │   ├── frozenlake_q_learning.ipynb   # Implement Q-Learning yourself
│   │   ├── sb3_quickstart.ipynb          # DQN/PPO with stable-baselines3
│   │   └── solutions/
│   └── README.md          # Notebook setup instructions
├── docs/
│   ├── DEVELOPMENT.md          # Maintainer setup (dev mode, local runs)
│   ├── INSTALLATION_LINUX.md   # Linux installation guide
│   ├── INSTALLATION_MACOS.md   # macOS installation guide
│   ├── INSTALLATION_WINDOWS.md # Windows installation guide
│   └── screenshots/            # Documentation screenshots
├── presentations/         # Workshop slides
├── docker-compose.yml     # Participant setup (self-contained images)
└── docker-compose.dev.yml # Maintainer override (bind mounts, hot reload)

Stopping, Updating, Troubleshooting

docker compose down                          # Stop the application
docker compose pull && docker compose up -d  # Update to the latest version
docker compose logs -f                       # Live logs (for bug reports)

More commands and troubleshooting recipes are in the installation guides.

References

Author

License

See LICENSE


Acknowledgements

drawing

The AI Service Centre Berlin Brandenburg is funded by the Federal Ministry of Research, Technology and Space under the funding code 16IS22092.

About

Interactive web interface for exploring simple reinforcement learning algorithms.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages