Q-Learning Agent playing Taxi-v3
This is a trained model of a Q-Learning agent playing Taxi-v3 .
Usage
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-Taxi-v3",
filename="q-learning.pkl",
local_dir="."
)
with open("q-learning.pkl", "rb") as f:
model = pickle.load(f)
env = gym.make(
"Taxi-v3",
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
Evaluation results
- mean_reward on Taxi-v3self-reported7.56 +/- 2.71