Git Product home page Git Product logo

Comments (4)

Khrylx avatar Khrylx commented on July 3, 2024

The value function also needs to be an RNN, or you can pass the rnn output from the policy to the value net.

from pytorch-rl.

sandeepnRES avatar sandeepnRES commented on July 3, 2024

Any help regarding how to use RNN? should it be used single step, or over an episode(specifying times steps as sequences)? and how will the backpropagation take place, all at once at the end of episode? Do you have any code regarding this available?

from pytorch-rl.

Khrylx avatar Khrylx commented on July 3, 2024

I don't have any code for RNN yet. But I can imagine how it can be done.

Suppose the agent collected a batch of three episodes of length 5,6,7, so the total length is 18. You need to pad these episodes to be of the same length 7. So you will have an input size 7 x 3 x d, where d is your input dim. Then you pass it through an LSTM, which will give you an output of size 7 x 3 x h, where h is the output dim. You reshape it into 21 x h, and find where the episode steps (5,6,7) correspond to by indexing operation, then you will get the right output of 18 x h. Then you can just pass this to an MLP or any other network you want. All these operations are achievable by pytorch.

from pytorch-rl.

sandeepnRES avatar sandeepnRES commented on July 3, 2024

Okay, but should the functions like get_log_probability which is used in ppo step, be updated? because they compute forward propagation, getting new hidden vector after every backpropagation. or should the new hidden vector be ignored, and old hidden vector be used(that was obtained during data collection by agent).

from pytorch-rl.

Related Issues (20)

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.