Skip to content

SFETNI/microRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microRL

Small single-file browser demo that visualizes a tiny reinforcement learning agent training in a grid world.

Run locally

  1. Start a simple HTTP server from the repository root:
python3 -m http.server 8000 --directory .
  1. Open the demo in your browser:

http://localhost:8000/microrl.html

Demo

microRL demo

Controls

  • Pause / Resume — pause the simulation
  • Reset — restart environment and agent
  • Speed slider — how many train steps per frame
  • Q-map checkbox — overlay per-cell max Q-value heatmap

What I added

  • Q-value heatmap overlay (toggleable)
  • Smooth agent motion and simple collect/death visual cues
  • A small Python script test_rl.py that runs a tabular Q-learning equivalent to validate learning outside the browser

Python test

Run the included Python test to see equivalent training in a headless mode:

python3 test_rl.py --episodes 500

The script prints per-episode rewards and writes rewards.csv with one reward per line.

Files

  • microrl.html — main browser demo
  • test_rl.py — minimal Python Q-learning test
  • LICENSE — MIT license
  • CONTRIBUTING.md — short contributing notes

Notes

  • microrl.html is ~10KB and under the 50KB threshold; no further shrinking applied.

About

Small single-file browser demo that visualizes a tiny reinforcement learning agent training in a grid world.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors