I’ve being using action.reinforce(reward) for policy gradient based training, but it seems like there’s been a change recently and I get an error stating:
File “/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/torch/autograd/variable.py”, line 209, in reinforce
if not isinstance(self.grad_fn, StochasticFunction):
NameError: name ‘StochasticFunction’ is not defined
I read on github 14 that .reinforce is being deprecated, and it’s suggested to use torch.distributions.
Is there a reason for this change? Reinforce seemed relatively simple and intuitive. It’ll be great if the reinforce example from pytorch 18 is updated to reflect this change.