Downloads · 30 days
0
aryannzzz/q-learning-frozenlake-scratch
q-learning-frozenlake-scratch is a reinforcement learning model from aryannzzz. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for custom. The card lists the license as mit.
This is a tabular Q-learning agent trained from scratch on the FrozenLake-v1 environment using only NumPy and Gymnasium.
Downloads · 30 days
0
Access
Public
Updated Dec 21, 2025
Repo size
108 KB
Likes
0
Public
Click a slice to open those files.
.png144 KB · 97%
From the Hugging Face model README
This is a tabular Q-learning agent trained from scratch on the FrozenLake-v1 environment using only NumPy and Gymnasium.
FrozenLake-v1 is a classic RL environment where an agent navigates a 4x4 frozen grid to reach a goal while avoiding holes. The surface is slippery, making deterministic policies challenging.
The agent achieves a 100% success rate after training:

import pickle
import gymnasium as gym
from huggingface_hub import hf_hub_download
# Download model
model_path = hf_hub_download(
repo_id="aryannzzz/q-learning-frozenlake-scratch",
filename="q_learning_model.pkl"
)
# Load Q-table
with open(model_path, 'rb') as f:
data = pickle.load(f)
q_table = data['q_table']
config = data['config']
# Use the agent
env = gym.make('FrozenLake-v1')
state, _ = env.reset()
done = False
total_reward = 0
while not done:
action = q_table[state].argmax() # Greedy policy
state, reward, terminated, truncated, _ = env.step(action)
total_reward += reward
done = terminated or truncated
print(f"Total Reward: {total_reward}")
env.close()
q_learning_model.pkl - Complete Q-table and configurationq_learning_training.png - Training progress visualizationq_table_visualization.png - Q-table heatmapThis model was trained using custom Q-learning implementation:
01_q_learning_from_scratch.pyIf you use this model, please reference:
@misc{q-learning-frozenlake-scratch,
author = {aryannzzz},
title = {Q-Learning FrozenLake Model from Scratch},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/aryannzzz/q-learning-frozenlake-scratch}
}