GithubHelp home page GithubHelp logo

doroh70 / notpac-man Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaelan-c/notpac-man

0.0 0.0 0.0 93 KB

Reinforcement Learning Workshop for the University of Lethbridge Computer Science Club

License: MIT License

Python 100.00%

notpac-man's Introduction

!Pac-Man: Reinforcement Learning Workshop

University of Lethbridge Computer Science Club

Welcome to the !Pac-Man Reinforcement Learning Workshop! This project is designed to introduce you to the fundamentals of reinforcement learning (RL) through the implementation of an AI agent that learns to play a Pac-Man-like game.

Project Overview

!Pac-Man is a simplified version of the classic arcade game Pac-Man. In this workshop, you'll use reinforcement learning techniques to train an AI agent to navigate through a maze, eat dots, avoid ghosts, and try to score as high as possible. The game is built using Python and Pygame, offering a hands-on experience with a Q-Learning Agent implementation.

Prerequisites

  • Basic knowledge of Python programming (Not Required but nice to have).
  • Familiarity with fundamental concepts in machine learning or AI is helpful but not required.
  • Python 3.6 or higher installed on your system.
  • Python Dependencies installed:
    • Pygame pip install pygame
    • Numpy pip install numpy
    • Pickle pip install pickle-mixin

Getting Started

  1. Clone the Repository: Clone this repository to your local machine using: -git clone https://github.com/kaelan-c/notpac-man.git or
  • Downloading the code directly as a zip file.
  1. Install Dependencies: Ensure you have Python and the Dependencies installed on your system.

    For All Platforms:

    • Install Python: Ensure you have Python installed on your system. If not, download and install Python from python.org.

    For Mac:

    1. Install Homebrew: Homebrew is a package manager for macOS. Install it from brew.sh if you don't already have it.
    2. Install Python and Packages:
      brew install python3
      pip3 install pygame numpy pickle-mixin

    For Linux:

    1. Install Python:

      • For Ubuntu/Debian-based systems:
        sudo apt update
        sudo apt install python3 python3-pip
      • For Fedora:
        sudo dnf install python3 python3-pip
      • For Arch Linux:
        sudo pacman -S python python-pip
    2. Install Packages:

      pip3 install pygame numpy pickle-mixin

    For Windows:

    1. Install Python:
      • Download the Python installer from python.org.
      • Run the installer. Ensure to check the box that says "Add Python to PATH" during installation.
    2. Install Packages:
      • Open Command Prompt (CMD) as an administrator.
      • Install the packages using pip:
        pip install pygame numpy pickle-mixin

    Verification

    To verify that everything is installed correctly, you can run the following command in your terminal or command prompt:

    python -c "import pygame, numpy, pickle; print('Success')"

    If you see the word 'Success' without any errors, you have successfully installed the necessary dependencies.

  2. Explore the Code: The project consists of several Python files that define the game environment, the AI agent, and the training script.

    • game.py: Contains the game logic and rendering for !Pac-Man.
    • agent.py: Defines the AI agent using Q-learning.
    • train.py: Script to train the AI agent.
    • Other game resource files like gamemap.py, ghost.py, etc.
  3. Train the AI: To train the AI agent, run python train.py. This will start the training process, and you can observe how the AI learns over time.

  4. Run the Game: You can run the game to see the AI in action. Use python main.py to start.

Workshop Goals

  • Understand Reinforcement Learning: Grasp the basics of how reinforcement learning works.
  • Explore an AI Agent Implementation: Learn how a basic Q-learning agent is implemented.
  • Experiment and Learn: Experiment with different parameters, reward structures, and state representations to see how they affect the AI's learning process.

Contributing

We welcome contributions and suggestions! Please feel free to fork the repository, make changes, and submit pull requests. If you find any issues or have ideas for improvements, don't hesitate to open an issue.

notpac-man's People

Contributors

kaelan-c avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.