All Projects → vivek3141 → pacman-ai

vivek3141 / pacman-ai

Licence: GPL-3.0 license
A.I. plays the original 1980 Pacman using Neuroevolution of Augmenting Topologies and Deep Q Learning

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pacman-ai

neat-openai-gym
NEAT for Reinforcement Learning on the OpenAI Gym
Stars: ✭ 19 (-26.92%)
Mutual labels:  neat, neuroevolution, neat-python
NeuroEvolution-Flappy-Bird
A comparison between humans, neuroevolution and multilayer perceptrons playing Flapy Bird implemented in Python
Stars: ✭ 17 (-34.62%)
Mutual labels:  neat, neuroevolution, neat-python
Easy Rl
强化学习中文教程,在线阅读地址:https://datawhalechina.github.io/easy-rl/
Stars: ✭ 3,004 (+11453.85%)
Mutual labels:  q-learning, dqn
Ctc Executioner
Master Thesis: Limit order placement with Reinforcement Learning
Stars: ✭ 112 (+330.77%)
Mutual labels:  q-learning, dqn
Deep-Reinforcement-Learning-With-Python
Master classic RL, deep RL, distributional RL, inverse RL, and more using OpenAI Gym and TensorFlow with extensive Math
Stars: ✭ 222 (+753.85%)
Mutual labels:  q-learning, dqn
Gym Anytrading
The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
Stars: ✭ 627 (+2311.54%)
Mutual labels:  q-learning, dqn
Reinforcement Learning With Tensorflow
Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学
Stars: ✭ 6,948 (+26623.08%)
Mutual labels:  q-learning, dqn
NEATEST
NEATEST: Evolving Neural Networks Through Augmenting Topologies with Evolution Strategy Training
Stars: ✭ 13 (-50%)
Mutual labels:  neat, neuroevolution
rl implementations
No description or website provided.
Stars: ✭ 40 (+53.85%)
Mutual labels:  dqn, deep-q-learning
neuro-evolution
A project on improving Neural Networks performance by using Genetic Algorithms.
Stars: ✭ 25 (-3.85%)
Mutual labels:  neat, neuroevolution
evo-NEAT
A java implementation of NEAT(NeuroEvolution of Augmenting Topologies ) from scratch for the generation of evolving artificial neural networks. Only for educational purposes.
Stars: ✭ 34 (+30.77%)
Mutual labels:  neat, neuroevolution
Paddle-RLBooks
Paddle-RLBooks is a reinforcement learning code study guide based on pure PaddlePaddle.
Stars: ✭ 113 (+334.62%)
Mutual labels:  q-learning, dqn
Explorer
Explorer is a PyTorch reinforcement learning framework for exploring new ideas.
Stars: ✭ 54 (+107.69%)
Mutual labels:  q-learning, dqn
Deep traffic
MIT DeepTraffic top 2% solution (75.01 mph) 🚗.
Stars: ✭ 47 (+80.77%)
Mutual labels:  q-learning, dqn
neat-python
Python implementation of the NEAT neuroevolution algorithm
Stars: ✭ 32 (+23.08%)
Mutual labels:  neuroevolution, neat-python
Deep Rl Trading
playing idealized trading games with deep reinforcement learning
Stars: ✭ 228 (+776.92%)
Mutual labels:  q-learning, dqn
Tensorflow-Neuroevolution
Neuroevolution Framework for Tensorflow 2.x focusing on modularity and high-performance. Preimplements NEAT, DeepNEAT, CoDeepNEAT, etc.
Stars: ✭ 109 (+319.23%)
Mutual labels:  neat, neuroevolution
DeepHyperNEAT
A public python implementation of the DeepHyperNEAT system for evolving neural networks. Developed by Felix Sosa and Kenneth Stanley. See paper here: https://eplex.cs.ucf.edu/papers/sosa_ugrad_report18.pdf
Stars: ✭ 42 (+61.54%)
Mutual labels:  neat, neuroevolution
king-pong
Deep Reinforcement Learning Pong Agent, King Pong, he's the best
Stars: ✭ 23 (-11.54%)
Mutual labels:  q-learning, dqn
dnapacman
waka waka
Stars: ✭ 15 (-42.31%)
Mutual labels:  pacman

Pacman AI

This project builds a program that can play the original 1980 Atari Pacman. The approaches used are Deep-Q-Learning and Neuroevolution of Augmenting Topologies

Running The Program

Use the Makefile to run various parts of this project.

  • NEAT
    • Train - make neat-train
    • Test - make neat-test
  • DQN
    • Train - make rl-train
    • Test - make rl-test
  • Q Learning Demo - make q-learning

Alternative

main.py usage

python3 main.py [algorithm] [train/test]

Requirements

Install the requirements with

pip install -r requirements.txt

Alternative

sudo make install

NEAT - Neuroevolution of Augmenting Topologies

All files using NEAT are stored under NEAT/

Train the NEAT model:

make neat-train

Test the NEAT model:

make neat-test

Explanation

For an explanation on a project using the same algorithm watch this video.

Short Explanation

This program uses a mathematical model, called a neural network, which simulates the brain of a human being. A neural network works by taking inputs and outputting probabilities for each of the outputs. This can be accomplished by using a sigmoid function.

Sigmoid

Neuroevolution of Augmenting Topologies, or NEAT is what this project uses. The way standard neuroevolution works is by randomly initializing a population of neural networks and using survival of the fittest to get the best model. The best networks in each generations are bred and some mutations are introduced. NEAT introduces features like speciation to make a much more effective neuroevolution model. Neuroevolution is known to do better than standard reinforcement learning models.

DQN - Deep Q-Learning

All files using DQN are stored under DQN/

Train the DQN model:

make rl-train

Test the DQN model:

make rl-test

Explanation

Q-Learning

Q-learning learns the action-value function Q(s, a): how good to take an action at a particular state. Here's what each term means:

  • state - The observation you take from the environment. In this case, it would be an image of the Pacman game or the RAM of the Atari console.
    Pacman State

  • action - The program's output for this particular state. For example, an action would be to move left, up, right, or down in Pacman

  • reward - A reward is a number that tells how good or bad an episode was. In this case, the reward can be the score.

  • Q(s, a) - Q is called the action-value function. In Q Learning, we build an table, called the Q-Table for every state action pair. This Q Table helps determine what action to choose.

This kind of state-action-reward system where the next state depends on the previous state is called Markov Decision Process.

MDP

How Q-Learning Works

Q-Learning

Deep-Q-Learning

Deep Q-learning is a special type of Q-Learning where the Q-function is learnt by a deep neural network. The input to the neural network is the state of the environment and the outputs are the Q-Values. The action with the maximum predicted Q-value is chosen as our action to be taken in the environment. DQN

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].