🧠 Q-Learning - FrozenLake-v1 (4x4 NoSlippery)
Reinforcement Learning Implementation using Q-Learning on FrozenLake-v1 (4x4 NoSlippery Environment)
Trained agent learns to navigate the frozen lake without slipping — reaching the goal optimally using value-based Q-Learning.
🚀 Overview
This project implements Q-Learning, one of the most fundamental Value-Based Reinforcement Learning algorithms, on Gymnasium’s FrozenLake-v1 environment with the 4x4 grid and no slipperiness enabled.
The environment is deterministic, allowing the Q-Learning agent to converge faster and find an optimal policy through iterative updates of the Q-table.
Environment: FrozenLake-v1
Mode: 4x4, is_slippery=False
Algorithm: Q-Learning
Framework: Python + NumPy + Gymnasium
Usage
model = load_from_hub(repo_id="AminVilan/QLearning-FrozenLake-v1-4x4-NoSlippery", filename="q-learning.pkl")
🤖 Model Card
The model includes:
- Trained Q-table (
q-learning.pkl)
- Hyperparameters and configuration
- Evaluation script
- Demo notebook to visualize policy and performance
🧩 Algorithm Description
Q-Learning is a model-free, off-policy algorithm used to find the optimal action-selection policy for any given finite Markov Decision Process (MDP).
The agent updates the Q-values using the Bellman equation.
🧠 Training Details
| Parameter | Value |
|---|
| Environment | FrozenLake-v1 (4x4, NoSlippery) |
| Episodes | 10,000 |
| Learning Rate (α) | 0.7 |
| Discount Factor (γ) | 0.95 |
| Exploration Strategy | ε-Greedy |
| Epsilon Decay Rate | 0.0005 |
| Minimum Epsilon | 0.05 |
🧾 Results
- ✅ Converged Policy: Optimal deterministic path to goal
- 🏁 Average Reward: 1.00 +/- 0.00
- 📈 Q-table visualization shows strong convergence around the goal states.
📝 License
This repository is licensed under the GPL License.
See the LICENSE file for more details.
🙌 If you find this useful, please ⭐ it on Github 🤗