ReverseDiff.jl icon indicating copy to clipboard operation
ReverseDiff.jl copied to clipboard

Pullback function

Open ConnorMallon opened this issue 2 years ago • 2 comments

Does ReverseDiff.jl have a something similar to y,pb=Zygote.pullback(f,x) which builds a pullback function pb that can be called on an output tangent Δy and when called internally does the vector-jacobian product without assembling the jacobian ?

ConnorMallon avatar Apr 23 '22 04:04 ConnorMallon

You can do it by hacking a little around the internals of ReverseDiff but it's not easy to do. Look at the ReverseDiff code in AbstractDifferentiation.jl for a hint. I am currently refactoring AbstractDifferentiation though so I don't want to recommend using it for now.

mohamed82008 avatar Apr 23 '22 04:04 mohamed82008

I don't want to recommend using AbstractDifferentiation now but you can adapt the implementation there for your purposes.

mohamed82008 avatar Apr 23 '22 04:04 mohamed82008