Giter VIP home page Giter VIP logo

deeprl-flappybird's Introduction

DeepRL-FlappyBird

Pytorch implementation of Deep Q-Networks (with different operators) for Flappy Bird environment. Deep Q-Learning has been shown to suffer from an overestimation problem due to the use of the max operator (due to Jensen's inequality and convexity of the max). Multiple replacements for the max operator are tested in the Flappy Bird environment.

Links to the original papers are embedded below:

Mellowmax:
Asadi, K., & Littman, M. L. (2017, June 14). An alternative softmax operator for reinforcement learning. arXiv.org. Retrieved September 13, 2022, from https://arxiv.org/abs/1612.05628

Adaptive Mellowmax:
“Adaptive temperature tuning for mellowmax in deep ... - brown university.” [Online]. Available: https://cs.brown.edu/people/gdk/pubs/tuning_mellowmax_drlw.pdf. [Accessed: 14-Sep-2022].

Soft Mellowmax:
Y. Gan, Z. Zhang, and X. Tan, “Stabilizing Q learning via soft Mellowmax operator,” arXiv.org, 18-Dec-2020. [Online]. Available: https://arxiv.org/abs/2012.09456. [Accessed: 13-Sep-2022].


Dependencies

Install requirements:

pip install -r requirements.txt

Running the Code

First, determine the algorithm you want to run. You can modify the parameters of the code in the corresponding config file in the configs folder. To help you better understand the input parameters, we list them below:

model_save_path: folder to save policy model
load_path: load a model's weight from this path
results_save_path: folder to save the quantitative data that is recorded every iteration
game_run_path: folder to save quantitative data saved during an episode
mode: train or test model
save_every: save model, data every X iteration
temperature: temperature of an operator

After setting the parameters to your preference, run

python deepmellow_dqn.py --config configs/dm_param.txt

for the deepmellow operator. Change the .py and .txt files accordingly if you want to use another operator.


Acknowledgement:

This code borrows the Flappy Bird interface from:
https://github.com/nevenp/dqn_flappy_bird

We thank the author for the contribution to this project.

deeprl-flappybird's People

Contributors

allan-linn 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.