Giter Site home page Giter Site logo

self-attention-ppo-pytorch's Introduction

Self-Attention PPO Pytorch

I was inspired by this paper which described few methods to approach for Attention for Reinforcement Learning.
I decided that it will be best to implement simplest one.

This implementation don't have to be correct even though it works better than version without Attention.

Setup

# Create and activate virtual environment.
python3 -m venv venv
# Install packages
pip install -r requirements.txt
# Run program
python main.py

Tensorboard

To run tensorboard use this command:

tensorboard --logdir runs

Lint

To lint code use this command:

black .

Troubleshooting

  • (Ubuntu) During installation of tensorboard I encountered an error that required from me to install python3-dev package.

self-attention-ppo-pytorch's People

Contributors

rvuvuzelam avatar

Stargazers

Xuan Liu avatar  avatar Jinglong Shen avatar  avatar  avatar  avatar  avatar Ali Irshayyid avatar  avatar  avatar ConnoRLuv avatar XuNoNo avatar Iñigo Ballester avatar WANCCY avatar Jiawei_SHI avatar  avatar Liang7 avatar  avatar Dong Chen avatar  avatar Adrian Niglus avatar  avatar jiangz avatar  avatar alex liu avatar Adrian Ciura avatar  avatar

Watchers

 avatar paper2code - bot avatar

self-attention-ppo-pytorch's Issues

(Implementation question) Multiheaded Attention

Hi @RvuvuzelaM , I just studied your code and realised that you have implemented multiheaded attention differently from the authors. Do you mind explaining the theory of your implementation of multiheaded attention?

The standard implementation of scaled product attention uses softmax( Q transposed * K / sqrt(size)), however your implementation permutes q,k,v, into (0,2,3,1) which swaps channel with height and weight before going into a Q transposed * K and so on. Mathematically, the tensors end up being the same shape but do you mind explaining what is the meaning of each step in doing it this way? How does a pure matrix multiplication behaves as an attention layer and are there any learnable parameters in your attention layer?

Thanks!

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.