Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q-learning implementation for Taxi-v3 environment #1274

Open
1 task done
ArshiaIlaty opened this issue Dec 16, 2024 · 2 comments
Open
1 task done

Q-learning implementation for Taxi-v3 environment #1274

ArshiaIlaty opened this issue Dec 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ArshiaIlaty
Copy link
Contributor

Proposal

Code Overview

  1. Q-Learning Agent (QLearningAgent class):

    • Implements a Q-learning algorithm with epsilon-greedy exploration
    • Maintains a Q-table to learn state-action values
    • Features include:
      • Epsilon decay for reducing exploration over time
      • Handling of action masks (valid actions)
      • Learning rate and discount factor configuration
  2. Training Function (train_taxi()):

    • Trains the agent for a specified number of episodes
    • Uses a progress bar to track training
    • Tracks and stores episode rewards
    • Periodically reports average reward and current epsilon value
  3. Testing Function (test_agent()):

    • Evaluates the trained agent in the Taxi environment
    • Renders the environment for visual demonstration
    • Prints total reward for each episode

Environment Details

The Taxi-v3 environment is a grid-world problem where an agent must:

  • Pick up a passenger at one of four locations
  • Drop the passenger at another specified location
  • Navigate efficiently while avoiding invalid moves

Motivation

Training agents improvement and I can expand it to the other agents, such as Cliff Walking Agent

Pitch

No response

Alternatives

No response

Additional context

No response

Checklist

  • I have checked that there is no similar issue in the repo
@ArshiaIlaty ArshiaIlaty added the enhancement New feature or request label Dec 16, 2024
@ArshiaIlaty ArshiaIlaty changed the title [Proposal] Q-learning implementation for Taxi-v3 environment Q-learning implementation for Taxi-v3 environment Dec 16, 2024
@pseudo-rnd-thoughts
Copy link
Member

pseudo-rnd-thoughts commented Dec 18, 2024

How is this unique for the tutorials that already exist? Other than being for a difference environment?

@ArshiaIlaty
Copy link
Contributor Author

The uniqueness of this work lies in the specific focus on the Taxi and CliffWalking environments, for which comprehensive tutorials and code implementations for Q-learning are currently lacking. While tutorials for environments like FrozenLake and Blackjack with Q-learning are readily available and were referenced, I noticed the gap in resources for these other environments.

To address this, I created and provided the necessary code for the Taxi and CliffWalking environments to help fill that gap and make it easier for others to explore and learn. Please find the attached files for your reference.

Policy Grid In CliffWalking
Reward per Episode in CliffWalking
Rewards per Episode in Taxi Env

Screen.Recording.2024-12-18.at.11.15.50.AM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants