Downloads · 30 days
0
Konzai/q-FrozenLake-v1
q-FrozenLake-v1 is a reinforcement learning model from Konzai. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product.
This is a trained model of a Q-Learning agent playing FrozenLake-v1 .
Downloads · 30 days
0
Access
Public
Updated Oct 9, 2025
Repo size
916 B
Likes
0
Public
Click a slice to open those files.
.mp431.2 KB · 89%
From the Hugging Face model README
This is a trained model of a Q-Learning agent playing FrozenLake-v1 .
import gymnasium as gym
from huggingface_hub import hf_hub_download
import numpy as np
import pickle
model_file = hf_hub_download(
repo_id="Konzai/q-FrozenLake-v1",
filename="q-learning.pkl",
local_dir="."
)
with open("q-learning.pkl", "rb") as f:
model = pickle.load(f)
env = gym.make(
"FrozenLake-v1",
map_name="4x4",
is_slippery=False,
render_mode="human"
)
n_show_episodes = 3
max_steps = model["max_steps"]
q_table = model["q_table"]
for episode in range(n_show_episodes):
state, info = env.reset()
for step in range(max_steps):
action = np.argmax(q_table[state, :])
state, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
break