ReverseDiff.jl
ReverseDiff.jl copied to clipboard
Pullback function
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 ?
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.
I don't want to recommend using AbstractDifferentiation now but you can adapt the implementation there for your purposes.