-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with AD when using orthogonal #18
Comments
Oooo this is interesting. Looking at our @oxinabox do you have any idea how the de-structuring mechanism works? I've just taken a look at LinearAlgebra, but it's not at all obvious to me how the |
Could you elaborate on what you think the issue is? function nearest_orthogonal_matrix_twostep(X::StridedMatrix{<:Union{Real, Complex}})
# Inlining necessary for type inference for some reason.
F = svd(X)
return F.U * F.V'
end also fails, so I am not sure how de-structuring is an issue? |
Oh, I hadn't realised that. I'm now thoroughly confused 😂 edit: so it sounds to me like some kind of an accumulation issue, or an issue when there are non-zero cotangents for multiple bits of the |
Yeah, same, it looks like the accumulation of gradients of F is broken? |
Yeah, that's the only thing I can come up with. In any case, this issue definitely seems like it warrants a |
Yeah, I had meant to edit in that I had tried this one too. Also, breaking it up into
|
Yep |
Solved by FluxML/Zygote.jl#922 |
I'm encountering issues in using Zygote to AD through
orthogonal
. I note that in the present test, we do test that AD works, but as I understand it, we do not test for correctness. .This is a MWE example that demonstrates this with FiniteDifferences. I do include a variant that should be identical in the forward pass that appears to be correct in the backward pass. I'm not too familiar with the AD ecosystem, but it is possible this should be an issue in
ChainRules
because that is where therrules
for SVD are defined. Perhaps the rules there are not quite catching the the algebra in nearest_orthogonal_matrix correctly?The text was updated successfully, but these errors were encountered: