Giter Site home page Giter Site logo

dqnflappy's Introduction

Flappy Bird DQN

This repo implements DQN in PyTorch from scratch, and learns to play Flappy Bird, specifically the PyGame/PLE implementation

example

In its current version, I get the following performance averaged over 20 episodes:

Algorithm Performance
DQN Vanilla 119.1

NB: The default arguments are the hyperparameters used to produce this.

Requirements

Usage

To visualise the agent with pre-trained weights, simply type:

python runFlappy.py

The various options are as follows:

python runFlappy.py

## High Level Settings
--mode 'test'                               # one of 'train' or 'test'
--testfile './models/trained_params.pth'    # location of pretrained model (if 'test' is selected)
--slow False                                # run at native 30 FPS (seems less stable)

## Training Settings
--frame_skip 3                              # how many frames will be skipped and the same action will be applied
--reward_shaping True                       # include a living reward
--frame_stack 4                             # how many frames to stack
--gamma 0.9                                 # future return discounting
--batch_size 32                             # size of batch from replay memory buffer
--memory_size 100000                        # size of the entire replay memory buffer
--max_ep_steps 1000000                      # how many steps we can spend in a single episode
--reset_target 10000                        # how many steps before syncing the target q-network
--final_exp_frame 500000                    # how many steps before we settle on the final exploration value
--save_freq 10000                           # how many steps between saving model parameters
--num_episodes 100000000                    # how many episodes to run in total (basically infinite)
--num_samples_pre 3000                      # how many samples under a random policy to initially load into the replay memory

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.