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
This PR addresses Issue #535, where GaussNewton (via NewtonDescent) diverges numerically when provided with a sparse jac_prototype in a NonlinearLeastSquaresProblem.
Add any other context about the problem here.
The root cause was that newtondescent skipped the Normal Form ($J^T J \Delta u = -J^T f$) for sparse matrices if the linear solver didn't explicitly signal a need for square matrices.
why do we want to use the normal form for sparse matrices?
Yeah I thought the error was occuring because the sparse matrix was in a rectangular form making the system ill-defined. Therefore attempted a brute force technique but it isn't the right solution.
normal form should be less numerically stable, just slightly faster
Based on my understnding of the issue till now, I think the best way here is to apply a line search technique so that the step size is shrinked in case such high residual norms appear.
Would highly appreciate any advice.
Thanks for the guidance. After digging a bit deeper (along with help from AI), I found out that in newton.jl, in case of sparse matrices, the in-place multiplication was silently dropping entries that fell outside the sparsity pattern of the initialized cache, as u changed. This resulted in a corrupted normal equations matrix and the subsequent garbage values.
I have made a new PR based on this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This PR addresses Issue #535, where GaussNewton (via NewtonDescent) diverges numerically when provided with a sparse jac_prototype in a NonlinearLeastSquaresProblem.$J^T J \Delta u = -J^T f$ ) for sparse matrices if the linear solver didn't explicitly signal a need for square matrices.
Add any other context about the problem here.
The root cause was that newtondescent skipped the Normal Form (