Hi,
I would like to use REINFORCE like described in the docs an tried this in my code, using PyTorch v0.4.0:
m = torch.distributions.categorical.Categorical(probs)
action = m.sample()
loss = -m.log_prop(action) * reward
probs
is a 128x10
Tensor (128 is the batch-size, 10 the number of actions)
Running the code I get the following error:
AttributeError: 'Categorical' object has no attribute 'log_prop'
What could I be doing wrong? I also found the log_prop
in torch/distributions/categorical.py
, so I do not really understand the error-message.