Jarrett Revels

Results 159 comments of Jarrett Revels

It's similar to the classic Hessian-vector product trick, just without the nested differentiation: ```julia julia> using ForwardDiff julia> x, y = rand(3), rand(3) ([0.243633, 0.330416, 0.632913], [0.0525042, 0.381907, 0.738228]) julia>...

ForwardDiff is giving the correct result, your implementation of Jacobi's Formula is incorrect: ```julia julia> using ForwardDiff julia> A = rand(3, 3); julia> adj(A) = det(A) * inv(A) adj (generic...

It does seem like ForwardDiff is giving the wrong answer here, thanks for pursuing this further @schrauf. I checked against ReverseDiff, whose answer matches SymPy: ```julia julia> using ForwardDiff, ReverseDiff...

Could it be because [the Base `det` definition](https://github.com/JuliaLang/julia/blob/master/base/linalg/generic.jl#L1157) converts lower triangular inputs (our pathological input here) to `UpperTriangular` arrays: ```julia function det{T}(A::AbstractMatrix{T}) if istriu(A) || istril(A) S = typeof((one(T)*zero(T) +...

Not really. I'll do some digging though, this is pretty interesting. I wonder if there are similar cases in Base linear algebra code where the optimizations aren't dual-safe. As far...

So I'm at ISMP 2018 and just saw a talk where something clicked for me. It turns out that these sorts of problematic functions can be modeled as piecewise differentiable...

> Ah, could that be Abs Normal Form that you were talking about? Yes.

For the OP, it might suffice just to add `:Irrational` to the list [here](https://github.com/JuliaDiff/ReverseDiff.jl/blob/b2e0e1ba8e7b051385132c663c85437a56a70557/src/ReverseDiff.jl#L21). For the second issue, that seems like a problem with whatever target code is calling that...

I believe this is actually [hitting the n-ary fallback](https://github.com/JuliaDiff/ReverseDiff.jl/blob/master/src/macros.jl#L81), which does indeed still work, but isn't doing the whole of the differentiation in forward mode: ```julia julia> import ReverseDiff julia>...

> So, a function with >2 arguments is compiled using a mixture of forward and reverse mode differentiations, right? Yup. > I don't know why this limitation exists but I'm...