-
Notifications
You must be signed in to change notification settings - Fork 152
Adds maxabs
check in norm2
#964
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
Conversation
Okay, I just found out that this solves the issue if |
I think the check should be in |
I understand that this will incur extra computation time, but I don't think it is correct to leave it as it is, since it is inconsistent with the numerical results from Julia base. Nonetheless, if you guys decide not to go forward with this change due to the extra computation time, I would like to propose an alternative |
Could someone explain why this checks are supposedly missing or needed? From reading the linked issues, I understand that this somehow affects AD - but how the added checks involve this isn't clear. As context, the analogous line of Base code linked in #908 (comment) appears to originate from JuliaLang/julia#10250 and was then, as I understand it, motivated by the fact that Base's It seems this change won't affect ordinary output of |
I didn't see any reason to add this check apart from making ForwardDiff.jl work as expected but I didn't analyse it particularly deeply and assumed that maybe I'm missing something. From your investigation it just looks like a ForwardDiff.jl issue, unless we actually want that rescaling in StaticArrays.jl (we probably don't?) |
The I agree it is not clear that this is a StaticArrays issue. As somewhat circumstantial evidence, #908 doesn't intersect with |
Thank you both for your comments. If this is not an issue with StaticArrays.jl, do you have any idea where the issue could be then? To be clear, when I found that AD-ing a function which takes the |
I think that ForwardDiff is doing something like 0/0 here in the generic algorithm, but the special case |
I think we can probably close this PR, given the above discussion, correct? I'll close in a few days if there's no objections. |
For the record, I have switched to using |
This PR addresses #963. I manually checked this and it does indeed get rid of the
NaN
s. The values of the jacobians in the MWE also agree with each other.@mateuszbaran, could you please review these changes? I am not sure if the check should be done where I put it. Thank you!