Use pymc's dlogp with rewrites
dehorsley opened this issue · comments
David Horsley commented
With pymc-devs/pymc#6736 merged, pymc rewrites the logp graph before applying the gradient. This removes some Ops from the graph, which should have some performance benefits in general but mainly target at pymc-devs/pymc#6717. Currently, nutpie calculates dlogp itself here:
Line 197 in 69eb0ce
I think this can be replaced with a simple
grads = model.dlogp(value_vars)
Though I think we can also drop the value_vars
, it only seems to be used for the grad.
Adrian Seyboldt commented