Skip to content

This project is a demonstration of training a Reinforcement Learning (RL) agent to play the classic Atari Breakout game using Double Deep Q-Networks (DDQN).

Notifications You must be signed in to change notification settings

pongthang/Atari-breakout-using-DDQN-RL_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Atari Breakout RL Agent

This project is a demonstration of training a Reinforcement Learning (RL) agent to play the classic Atari Breakout game using Double Deep Q-Networks (DDQN).

Project Overview

The goal of this project is to develop an RL agent that can learn to play Atari Breakout effectively. The core components of this project include:

  1. Input Data: The RL agent receives input in the form of four consecutive images, representing subsequence time-steps of the Breakout game. These images are essential for the agent to understand the dynamics of the game, particularly the behavior of the ball.

  2. Q-Function: To make decisions about its actions, the RL agent utilizes a Q-function. In this project, a Convolutional Neural Network (CNN) is employed to extract important features from the input images. After passing through the CNN, the extracted features are further processed by a fully connected neural network to estimate the Q-values for various actions.

  3. RL Agent Training: With the Q-function in place, the RL agent is trained to play the game effectively. It learns to make decisions that maximize its expected cumulative rewards over time. Through repeated interactions with the game environment, the agent improves its decision-making abilities and learns optimal strategies.

Why Four Images?

Using four consecutive images as input provides the RL agent with a richer understanding of the game dynamics. By considering more frames, the agent can better infer the position, velocity, and acceleration of the ball, which are critical for making accurate decisions. While it is possible to use three images, the additional frame enhances the agent's ability to anticipate and react to changes in the game state.

Dependencies

Before running this project, ensure you have the following dependencies installed:

  • Python 3.x
  • PyTorch
  • Gym (OpenAI Gym, a toolkit for developing and comparing RL algorithms)
  • opencv
  • numpy
  • matplotlib

Getting Started

To get started with this project, follow these steps:

  1. Clone this repository to your local machine

  2. Install the required dependencies as specified above

  3. Run the jupyter notebook to train the RL agent:

  4. Monitor the training progress, and once the agent is adequately trained, you can test its performance in the game.

Configuration

Adjust hyperparameters, network architecture, and other settings to fine-tune the agent's performance.

Result

atari_breakout.mp4

Enjoy training your RL agent and watching it master Atari Breakout! 🎮🕹️

LICENSE

MIT LICENSE Copyright (c)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

This project is a demonstration of training a Reinforcement Learning (RL) agent to play the classic Atari Breakout game using Double Deep Q-Networks (DDQN).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published