chainerrl
chainerrl copied to clipboard
[WIP] Use chainer.as_variable
We no longer need to define our own function to wrap an array by a variable as chainer
has as_variable
since v4 (https://docs.chainer.org/en/v4.0.0/reference/generated/chainer.as_variable.html).
Do the args require grads?
Good point. It is difficult to guarantee that we won't compute gradient wrt mean
or var
of GaussianDistribution
, so maybe we should not use chainer.as_variable
here...
Some facts
- ~
ACER
computes gradient wrt Distribution.params viabackward
, notchainer.grad
, so it can be affected byrequires_grad=False
.~ Now ACER userschainer.grad
#511 - Currently
chainer.grad
can compute gradient even whenrequires_grad=False
, but this is a bug of Chainer and will be fixed (https://github.com/chainer/chainer/issues/5974) -
chainer.distributions
usechainer.as_variable
for properties, so they may have the same problem.