Giter Club home page Giter Club logo

dqn's Introduction

Deep Q-Learning

My objective for this project was to replicate DeepMind's Deep Q-Network agent as published in [1].

This repo contains my implementation in Python using tensorflow and OpenAI's gym.

[1] Mnih et al. 2015. "Human-level control through Deep Reinforcement Learning". Nature 518.

Pong.gif Boxing.gif Pacman.gif

Environment

python 2.7

tensorflow 1.0

gym 0.8.1

tqdm 4.11.2 (simply pip install tqdm if missing)

Folder structure

/code     code base
/logs     tensorboard logs and checkpoints
/models   saved models

Training

The agent be trained on any atari environment by running

 python main.py --env [atari-environment] # e.g. Pong-v3

OpenAI has a list of all available atari games. The only requirement is that you specify preprocessing options in config.py for any new environment.

All hyperparameters such as the learning rate for the Q-network or the exploration rate of the agent can be changed in main.py.

Loading trained agents

The final checkpoints for all trained agents are saved in /models. Each agent can be loaded and its control performance evaluated (by default using 20 episodes).

To load an agent go to the folder ./code and run:

 python evaluate.py --env Pong-v3 --n_episodes 20          # Pong agent
 python evaluate.py --env Boxing-v3 --n_episodes 20        # Boxing agent

where --env can be any gym environment.

dqn's People

Contributors

principalcomponent-zz avatar

Watchers

 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.