This repository provides a q-learning implementation for Mountain Car problem using OpenAI Gym
.
This code repository contains the implementation of Q-Learning agent for Mountain Car game. It is part of the lab exercise for the COSC-604 Artificial Intelligence course for masters students at Khalifa University.
QLearningAgent
: Contains the QLearningAgent class for Q-Learning algorithm.
run
: To run the training of the agent.
The agent is trained to play Mountain Car game which is a classic reinforcement learning problem where the agent has to learn to drive a car up a hill.
To get started, clone the repository and run the main.py file.
The Q-Learning algorithm is used to train the agent. The algorithm uses a Q-table to store the values of state-action pairs.
The objective of the agent is to drive the car up the hill and reach the goal position in the minimum number of steps possible.
The agent is trained for 10,000 episodes with a decay in the exploration rate after each episode.
Visualization of the game can be enabled by setting the visual parameter to True in the run function in the main.py file.
The code can be extended to implement other reinforcement learning algorithms such as SARSA and DQN.