You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think what's happening is related to the fact that Julia's eigvals(A) checks ishermitian(A) and if so calls an optimized eigvals(Hermitian(A)) function that only looks at the upper triangle of A. Zygote apparently looks at this and erroneously concludes that the derivative with respect to the lower triangle is zero, when in fact if you perturb the lower triangle Julia will call a different non-Hermitian algorithm.
(I'm not sure if the bug is in Zygote or ChainRules, to be honest.)
The text was updated successfully, but these errors were encountered:
Searching for ishermitian finds other similar checks.
ForwardDiff more often differentiates the implementation and is (or was) more prone to this problem, of promoting an accidental zero (or symmetry) into a structural one. JuliaDiff/ForwardDiff.jl#480 is the issue about this.
Agreed, this should definitely be fixed. Probably as simple as using a hermitian projection (which is I think a utility function elsewhere in ChainRules) instead of using triu!.
Zygote.jacobian(eigvals, A)
returns an incorrect answer ifA
happens to be symmetric: it returns an erroneous column of zeros:I think what's happening is related to the fact that Julia's
eigvals(A)
checksishermitian(A)
and if so calls an optimizedeigvals(Hermitian(A))
function that only looks at the upper triangle ofA
. Zygote apparently looks at this and erroneously concludes that the derivative with respect to the lower triangle is zero, when in fact if you perturb the lower triangle Julia will call a different non-Hermitian algorithm.(I'm not sure if the bug is in Zygote or ChainRules, to be honest.)
The text was updated successfully, but these errors were encountered: