Downloads · 30 days
0
Nharen/Reward_Rush_Q-learning_Stochastic_Frozen_Lake
Reward_Rush_Q-learning_Stochastic_Frozen_Lake is a reinforcement learning model from Nharen. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This repository contains a tabular Q-learning agent for the FrozenLake-v1 environment with slippery physics enabled.
Downloads · 30 days
0
Access
Public
Updated Dec 31, 2025
Repo size
665 B
Likes
0
Public
Click a slice to open those files.
.mp435.2 KB · 89%
From the Hugging Face model README
This repository contains a tabular Q-learning agent for the FrozenLake-v1 environment with slippery physics enabled.
The model uses a discrete Q-table with the following specifications:
import gymnasium as gym
import numpy as np
import pickle
from huggingface_hub import hf_hub_download
def run_frozen_lake_stochastic_test():
path = hf_hub_download(repo_id="Nharen/Reward_Rush_Q-learning_Stochastic_Frozen_Lake", filename="q-learning.pkl")
with open(path, "rb") as f:
q_table = pickle.load(f)
env = gym.make("FrozenLake-v1", is_slippery=True)
successes = 0
num_episodes = 100
for _ in range(num_episodes):
state, _ = env.reset()
done = False
while not done:
action = np.argmax(q_table[state])
state, reward, terminated, truncated, _ = env.step(action)
done = terminated or truncated
if terminated and reward == 1.0:
successes += 1
print(f"Goal Reach Rate: {successes}/{num_episodes}")
env.close()
if __name__ == "__main__":
run_frozen_lake_stochastic_test()