All Projects → xmfbit → Dqn Flappybird

xmfbit / Dqn Flappybird

Play flappy bird with DQN, a demo for reinforcement learning, implemented using PyTorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dqn Flappybird

Atari
AI research environment for the Atari 2600 games 🤖.
Stars: ✭ 174 (+370.27%)
Mutual labels:  dqn, rl
Mushroom Rl
Python library for Reinforcement Learning.
Stars: ✭ 442 (+1094.59%)
Mutual labels:  dqn, rl
Tianshou
An elegant PyTorch deep reinforcement learning library.
Stars: ✭ 4,109 (+11005.41%)
Mutual labels:  dqn, rl
Ros2learn
ROS 2 enabled Machine Learning algorithms
Stars: ✭ 119 (+221.62%)
Mutual labels:  dqn, rl
Pytorch Drl
PyTorch implementations of various Deep Reinforcement Learning (DRL) algorithms for both single agent and multi-agent.
Stars: ✭ 233 (+529.73%)
Mutual labels:  dqn, rl
Learning To Communicate Pytorch
Learning to Communicate with Deep Multi-Agent Reinforcement Learning in PyTorch
Stars: ✭ 236 (+537.84%)
Mutual labels:  dqn, rl
logrl
Logarithmic Reinforcement Learning
Stars: ✭ 25 (-32.43%)
Mutual labels:  dqn, rl
Autonomous Learning Library
A PyTorch library for building deep reinforcement learning agents.
Stars: ✭ 425 (+1048.65%)
Mutual labels:  dqn
Pytorch Rl
Deep Reinforcement Learning with pytorch & visdom
Stars: ✭ 745 (+1913.51%)
Mutual labels:  dqn
Aigames
use AI to play some games.
Stars: ✭ 422 (+1040.54%)
Mutual labels:  dqn
Deep Rl Keras
Keras Implementation of popular Deep RL Algorithms (A3C, DDQN, DDPG, Dueling DDQN)
Stars: ✭ 395 (+967.57%)
Mutual labels:  dqn
Minecraft Reinforcement Learning
Deep Recurrent Q-Learning vs Deep Q Learning on a simple Partially Observable Markov Decision Process with Minecraft
Stars: ✭ 33 (-10.81%)
Mutual labels:  dqn
Chainerrl
ChainerRL is a deep reinforcement learning library built on top of Chainer.
Stars: ✭ 931 (+2416.22%)
Mutual labels:  dqn
Amazon Sagemaker Examples
Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
Stars: ✭ 6,346 (+17051.35%)
Mutual labels:  rl
Reinforcement Learning With Tensorflow
Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学
Stars: ✭ 6,948 (+18678.38%)
Mutual labels:  dqn
Reinforcement Learning Algorithms
This repository contains most of pytorch implementation based classic deep reinforcement learning algorithms, including - DQN, DDQN, Dueling Network, DDPG, SAC, A2C, PPO, TRPO. (More algorithms are still in progress)
Stars: ✭ 426 (+1051.35%)
Mutual labels:  dqn
Rainbow Is All You Need
Rainbow is all you need! A step-by-step tutorial from DQN to Rainbow
Stars: ✭ 938 (+2435.14%)
Mutual labels:  dqn
Tensorflow Tutorial
Tensorflow tutorial from basic to hard, 莫烦Python 中文AI教学
Stars: ✭ 4,122 (+11040.54%)
Mutual labels:  dqn
Elegantrl
Lightweight, efficient and stable implementations of deep reinforcement learning algorithms using PyTorch.
Stars: ✭ 575 (+1454.05%)
Mutual labels:  dqn
Slm Lab
Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".
Stars: ✭ 904 (+2343.24%)
Mutual labels:  dqn

Flappy Bird With DQN

DQN is a technology to realize reinforcement learning, first proposed by Deep Mind in NIPS13(paper in arxiv), whose input is raw pixels and whose output is a value function estimating future rewards. Using Experience Replay, they overcame the problem of network training.

This demo is about using DQN to train a convolutional neural network to play flappy bird game. It is a practice when I learned reinforcement learning and partly reused songrotek's code, especially the game engine and basic idea. Thanks for sharing, thanks to the spirit and community of open source.

A video of the demo can be found on YouTube or 优酷 Youku if you don't have access to YouTube.

DQN implemented by PyTorch

PyTorch is an elegant framework published by Facebook. I implemented the neural network and training/testing procedure using PyTorch. So you need install PyTorch to run this demo. Besides, pygame package is needed by the game engine.

How to run the demo

Play the game with pretrained model

At the beginning, you can play the game with a pretrained model by me. You can download the pretrained model from Google Drive (or Baidu Netdisk if Google Drive is not available) and use the following commands to play the game. Make sure that the pretrained model is in the root directory of this project.

chmod +x play.sh
./play.sh

For more detail infomation about the meaning of the arguments of the program, run python main.py --help or refer to the code in main.py.

Train DQN

You can use the following commands to train the model from scrach or finetuning(if pretrained weight file is provided).

chmod +x train.sh
./train.sh   # please see `main.py` for detail info about the variables

Some tips for training:

  • Do not set memory_size too large(or too small). It depends on available memory in your computer.

  • It takes a long time to complete training. I finetuned the model several times and change epsilon of ϵ-greedy exploration manually every time.

  • When choose action randomly in training, I prefer to 'DO Nothing' compared to 'UP'. I think it can accelarate convergence. See get_action_randomly method in BrainDQN.py for detail.

Disclaimer

This work is based on the repo songrotek/DRL-FlappyBird and yenchenlin1994/DeepLearningFlappyBird. Thanks two authors!

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].