Coder Social home page Coder Social logo

branchingdqn's Introduction

Branching DQN

This repo holds an implementation of a PyTorch version of Branching Double Deep Q-Learning. It is based on my other repo for Double DQN: https://github.com/mome36/DoubleDQN and on the paper https://arxiv.org/pdf/1711.08946.pdf

Branching DQN allows a Q-Learning agent to select multiple actions simultaneously. It can be used for continuous control, as I've demonstrated in BipedalWalker-v2 or for controlling a video game character (yielding actions sur as Jump and Hit instead of Jump or Hit).

How to use:

To train an agent, run:

python dueling_dqn.py --env BipedalWalker-v2

To see the agent perform:

python enjoy.py --env BipedalWalker-v2

Performances

BipedalWalker-perf

branchingdqn's People

Contributors

mome36 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

branchingdqn's Issues

The calculation of loss function is inconsistent with the paper

loss = F.mse_loss(expected_q_vals, current_q_values)
In this line of code, current_q_values are the mean of all branches Q values, the same with equation 6 in the paper, y.
However, the calculation of loss function in equation 7 uses y_d, whitch means Q values of each branch.

Moreover, the size of expected_q_vals is [128, 1], but the size of current_q_values is [128, 4]. This cause a warning
UserWarning: Using a target size (torch.Size([128, 4])) that is different to the input size (torch.Size([128, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.

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.