Giter Site home page Giter Site logo

pytorch-dqn's Introduction

(D)DQN implementation in PyTorch

Overview

A very simple implementation of the original DQN algorithm from Minh et al 2015, as well as the Double DQN (DDQN) subsequently developed by van Hassalt et al 2015.

Includes easily introspectable training scripts for simple Gym environments, as well as the Switch task found in ma-gym.

  • agent.py: network and agent definitions
  • agent_args.py: simple dict for agent hyperparameters
  • train_cartpole.py: single-agent Gym training loop
  • train_switch_simple.py: multi-agent game from ma-gym. Train all agents concurrently on their own observations (highly unlikely to be successful)
  • train_switch_curriculum.py: encourage Switch training by starting training for only one agent at a time, leaving untrained agents to a no-op
  • train_switch_joint_obs.py: train agents concurrently, but on a joint observation space that concatenates all agent observations + a unique agent id

Example of Switch4 trained by train_switch_joint_obs.py

Usage

Just a simple $ python train_cartpole.py.

Edit hyperparams in agent_args.py.

Requirements

  • Python 3.6+
  • PyTorch 1.4+
  • Gym

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.