GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - leopoldch/RL-FrozenLake-Benchmark: Benchmark of reinforcement learning strategies under varying risk on FrozenLake

BranchesTags
Open more actions menu

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
environments
environments
 
 
scripts
scripts
 
 
strategies
strategies
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
README.md
README.md
 
 
main.py
main.py
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

RL FrozenLake Benchmark

Benchmarking risk-aware reinforcement learning on Gymnasium's FrozenLake 8x8. Compares SARSA, Q-Learning, and ERM Q-Learning (Entropic Risk Measure, Su et al. 2025) across three grid configurations designed to isolate the effects of stochasticity and topology on learned policies.

By @audrey-dv & @leopoldch

Environments

Three 8x8 grids with increasing risk levels:

  • baseline — 5% slip, 7 holes. Low-risk reference grid.
  • slippery — 30% slip, same 7 holes. Tests the effect of stochasticity alone.
  • riskDilemma — 30% slip, 28 holes. Constrained topology that forces a choice between a safe detour and a risky shortcut.

Results

30,000 episodes, 20 seeds, 95% CI. Smoothed with a 200-episode window.

Baseline — SARSA vs Q-Learning

SARSA converges to ~66% success with a low fall rate; Q-Learning stays around 31% success and falls into holes twice as often.

SARSA on baseline Q-Learning on baseline

riskDilemma — where ERM shines

On the constrained grid, ERM Q-Learning reaches 70% success vs ~54% for SARSA and ~41% for Q-Learning, with shorter successful trajectories.

ERM training on riskDilemma

Learned policies on riskDilemma

SARSA takes a cautious detour; ERM finds a more direct path while keeping a comparable fall rate.

SARSA ERM
SARSA policy ERM policy

Summary table

Environment Algorithm Success (%) Fall (%)
baseline SARSA 64.27 ± 0.47 23.48 ± 0.72
baseline Q-Learning 29.95 ± 0.73 58.49 ± 1.29
baseline ERM 59.67 ± 4.01 37.30 ± 3.38
riskDilemma SARSA 38.15 ± 2.36 23.75 ± 1.16
riskDilemma Q-Learning 39.59 ± 6.67 31.64 ± 4.78
riskDilemma ERM 66.30 ± 2.21 31.08 ± 1.25

Installation

uv sync
source .venv/bin/activate

Usage

python main.py --env <ENV> --strategy <STRATEGY> --episodes <N> --iterations <N> [--plot] [--render]
Argument Default Description
--env random baseline, slippery, riskDilemma, corridor, random
--strategy random sarsa, qlearning, erm, random
--episodes 60000 Training episodes
--iterations 20 Independent runs (different seeds)
--plot off Save training curves and policy maps
--render off Display the environment live
--window 200 Smoothing window for curves
--save-dir figures Output directory for plots

Examples

# Full benchmark run
python main.py --env riskDilemma --strategy erm --episodes 30000 --iterations 20 --plot

# Quick test
python main.py --env baseline --strategy sarsa --episodes 5000 --iterations 5 --plot

# Visual mode
python main.py --env baseline --episodes 5 --render

Code Formatting

uv run black .

About

Benchmark of reinforcement learning strategies under varying risk on FrozenLake

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.