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

Error with bunchkaufman factorization

Open juliohm opened this issue 3 years ago • 4 comments

Is there anything that I can do to help fix https://discourse.julialang.org/t/error-with-bunchkaufman-factorization-in-turing-jl/88174 ?

I don't have experience with the forward-diff functionality. I am a Turing.jl user who encountered this error about the missing method basically.

juliohm avatar Oct 03 '22 19:10 juliohm

ForwardDiff requires that code is written generically. The Bunchkaufman code only works for normal floating point numbers so that's why it errors.

KristofferC avatar Oct 03 '22 19:10 KristofferC

Thank you @KristofferC , so the fix should go in LinearAlgebra? Is there any workaround?

juliohm avatar Oct 03 '22 20:10 juliohm

If you can compute the derivative analytically you can add an overload for baunchkaufman(v::Vector{<:ForwardDiff.Dual}) that returns the correct Dual values but that might require reading a bit of the source code of ForwardDiff.

KristofferC avatar Oct 03 '22 20:10 KristofferC

Thank you, I will see what I can do. Most likely I will need to work on a short-term alternative with Turing.jl due to some internal deadlines. Perhaps if I change the autodiff backend to Zygote.jl things will work? I will give it a try.

juliohm avatar Oct 03 '22 20:10 juliohm