Skip to content

aihpi/workshop-rl1-introduction

Repository files navigation

Workshop: Reinforcement Learning I - Introduction

This repository contains the material used in the "Reinforcement Learning I - Introduction" workshop by the AI Service Center Berlin Brandenburg. It provides an educational interface, called RL Lab, for building intuition about reinforcement learning fundamentals. The backend is built on the environments of the gymnasium library.

Application Screenshot

Features

Setup and Installation

Prerequisites

  • Git
  • Docker Desktop running or Docker Engine

Quick Start (Experienced Users)

Already have git and Docker installed? Get started in 3 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 you can start the app (detached mode)
docker compose up -d
  1. Open browser to http://localhost:3030

First-time setup takes ~1-2 minutes (downloads pre-built images).

Note: Running in detached mode (-d) keeps your terminal free. To view logs if needed for debugging, open a separate terminal and run docker compose logs -f

Installation Guides (Beginners)

New to programming or Docker? Follow the installation guides:

📱 Windows

Windows Installation Guide

🍎 macOS

macOS Installation Guide

🐧 Linux

Linux Installation Guide

Useful Docker Commands

Once installed, here are some helpful commands:

docker compose up -d           # Start the application (detached mode)
docker compose down            # Stop the application
docker compose logs -f         # View live logs (for debugging, in separate terminal)
docker compose logs backend    # View only backend logs
docker compose logs frontend   # View only frontend logs
docker compose ps              # Check container status
docker compose restart         # Restart services

User Guide

Using the Tool

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

  2. Adjust parameters using the sliders:

    • Number of Episodes: Training duration
    • Exploration Rate (ε): Probability of random exploration
    • Learning Rate (α): How fast the agent learns
    • Discount Factor (γ): Importance of future rewards
  3. Start training: Click "Start Training" and watch real-time visualizations:

    • Environment viewer: Renders agent's last position of a training episode
    • Reward chart: Tracks training progress with statistics
    • Q-table heatmap: Visualizes learned action values (4×4 grid)
  4. Play policy: After training completes, click "Play Policy" to watch the trained agent execute its learned behavior step-by-step.

Hands-On Coding (Optional)

Want to implement Q-Learning yourself? After using RL Lab to build intuition, try the Jupyter notebook in the examples directory to implement Q-Learning yourself and see how the code works.

Instructions for how to get the notebooks running are in 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 implementation
│   ├── environments/      # Gymnasium environment handling
│   ├── training/          # Session management
│   ├── tests/             # Backend test suite
│   └── app.py             # Flask API server
├── frontend/              # React frontend
│   ├── src/
│   │   ├── components/    # React components
│   │   │   ├── ParameterPanel.jsx
│   │   │   ├── EnvironmentViewer.jsx
│   │   │   ├── RewardChart.jsx
│   │   │   ├── LearningVisualization.jsx
│   │   │   └── ControlButtons.jsx
│   │   ├── App.js         # Main application
│   │   └── api.js         # Backend communication
│   └── src/components/__tests__/  # Frontend test suite
├── docs/
│   ├── DEVELOPMENT.md          # Local development setup (without Docker)
│   ├── INSTALLATION_LINUX.md   # Linux installation guide
│   ├── INSTALLATION_MACOS.md   # macOS installation guide
│   ├── INSTALLATION_WINDOWS.md # Windows installation guide
│   └── screenshots/            # Documentation screenshots
└── docker-compose.yml     # Multi-container orchestration

Limitations

  • Currently limited to FrozenLake environment (4x4 grid)
  • Only Q-Learning algorithm implemented
  • Requires Docker for running the application

References

Author

License

MIT License - Free to use for educational purposes


Acknowledgements

drawing

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

About

Interactive web interface for exploring simple reinforcement learning algorithms.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors