Code Monkey home page Code Monkey logo

option-critic-pytorch's Issues

Biased gradients

you need to re-evaluate the features/state after the optimization step
optim.step()
because that updates the feature layer hence the features themselves

Should "--num-options 4" be added?

"python main.py --switch-goal True --env fourrooms"
Should "--num-options 4" be added?
For the fourrooms environment, the number of Option is 4.
Maybe it's something I didn't understand correctly, looking forward to and thank you for your answer.

Got an error of inplace operation while running the code

Hi, I got inplace operation message while running your code. It seems to be caused by wrong detach in calculating the loss function. I tried to find a similar issue but I could not find anything. Could you have a look at it?

Traceback (most recent call last):
  File "main.py", line 147, in <module>
    run(args)
  File "main.py", line 129, in run
    loss.backward()
  File "/home/mw/anaconda3/envs/HRL/lib/python3.6/site-packages/torch/_tensor.py", line 255, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
  File "/home/mw/anaconda3/envs/HRL/lib/python3.6/site-packages/torch/autograd/__init__.py", line 149, in backward
    allow_unreachable=True, accumulate_grad=True)  # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [32, 64]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

loss.backward error

Hello when I download the code and run it in my computer, and I met an error in loss.backward()
RuntimeError: one of the variables needed for gradient computaion has been modified by an inplace operation:[torch.FloatTensor [32, 64], which is output 0 of AsStrideBackward0, is at version 2; expected version 1 instead]

I didn't modify the code anywhere.
my dependencies
pytorch 1.3.0
python 3.6.13
tensorboard 2.0.2
gym 0.15.3

Why not clean replay buffer after each episode for on-policy policy gradient update?

Thanks for providing the pytorch version of option critic. I want to ask why don't we clean replay buffer after each episode for on-policy policy gradient update? I think both algorithm 1 in the paper and the derivation for the intra-option policy gradient theorem is done under the setting of on-policy setup. If we do not clean the replay buffer, importance sampling should be implemented to account for the off-policy update. But I did not see any part of code related to that. I tried to read the original Theano repo, but it seems that they did the same thing. Do you have any comments on this?

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.