Machine Learning Lab REAL RL
Q-Learning · SARSA · generated mazes · shifting environments

AI Training Arena

Train a real reinforcement-learning agent inside hand-built, procedurally generated and continuously shifting mazes. Resize the environment, change rewards, inspect the learned policy, then disable exploration and watch the AI use what it actually learned.

AGENT STATUS Ready
Maze Size
Generated mazes work best with odd dimensions.
Current: 21 × 21 · unlimited size
Environment
Left-click to edit. Ctrl-click or right-click a cell to inspect its learned Q-values.
Episode 0 · Step 0
AI agent
goal
hazard
wall
Quantum-protected FOV
Arrows = learned policy
Training Statistics
Updated after completed episodes.
Episodes
0
Success · Last 100
0%
Avg Reward
0
Best Path
—
Exploration ε
1.00
Learned States
0
Maze Cells
441
Quantum Shifts
0
Learning Controls
Larger mazes may need thousands of episodes.
Training speed 500 steps/frame
Learning rate α 0.20
Discount factor γ 0.97
Initial exploration ε 1.00
ε decay 0.997
Minimum ε 0.03
Distance reward shaping
Show learned policy
Q-value heatmap
⚛ Quantum Regen
Non-stationary shifting maze.
OFF
Protect visible cells during shift
Show protected FOV
In Quantum Regen mode, the environment periodically generates an entirely new maze. Cells currently inside the AI's forward field of view are restored from the old maze, so nearby geometry appears stable while unseen areas can change. The AI also receives a local wall-mask as part of its learning state, allowing it to react to changing nearby passages.
Reward Designer
Define what the AI considers desirable.
Learning Curve
Episode reward and 20-episode moving average.
Waiting for training data…
AI Brain Inspector
Inspect what the agent believes about a selected state.
State
Q(s,a) ← Q(s,a) + α[r + γ max Q(s′,a′) − Q(s,a)]
Recent Episodes
Reward and path length.
Environment State
Normal maze:
State = grid position.

Quantum Regen:
State = grid position + local wall configuration.

Therefore two visits to the same coordinate can become different RL states if Quantum Regen changed which neighboring passages are open.

This is still tabular reinforcement learning. There is no external AI API and no scripted route finder controlling the agent.
Keyboard: Space = train/pause · T = test · R = reset brain. Random Solvable and Quantum Regen use recursive-backtracking maze generation. Larger maps contain many more states, so increase training speed and episode limits when experimenting with 31×31 or 41×41 mazes.