Add an upper bound function for the operator norm.#275
Add an upper bound function for the operator norm.#275MaxenceGollier wants to merge 9 commits intoJuliaSmoothOptimizers:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #275 +/- ##
===========================================
+ Coverage 61.53% 84.61% +23.08%
===========================================
Files 11 13 +2
Lines 1292 1671 +379
===========================================
+ Hits 795 1414 +619
+ Misses 497 257 -240 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@MaxenceGollier @dpo @d1Lab, I conducted some benchmarks with the joss example, with solve! being more constraining: solve!(solver, reg_nlp, stats;
atol=1e-6,
rtol=1e-6,
verbose=1,
sub_kwargs=(max_iter=1000,),
opnorm_maxiter= ... % see below
)Below are my remarks concerning different operator–norm estimation
It works on both versions, showing that the instability is not simply due to using too few or too many power-method iterations.
fails on both versions. (with
Using ARPACK to compute the dominant eigenvalue leads to instability:
ARPACK introduces non-determinism and rounding differences that R2N does Even for a small value such as L-BFGS showed no errors with any operator-norm option. |
|
Wouldn't it be more numerically stable to have |
|
Hey @MaxenceGollier — I apologize, most of the errors mentioned earlier ERROR: LoadError: R2: prox-gradient step should produce a decrease but ξ = -7.653729494313895e288In this situation, the proximal operator is not computed accurately for I ran additional experiments using: sub_kwargs = (max_iter = 0,)
atol = rtol = 1e-4to force the selection of Specifically:
So overall, this is good news:
|
I am not entirely sure whether this will make the problem disappear, because it is not The check on the condition In fact, as far as I can see in the benchmarks |
|
Ok. Still, can we compare in term of time or number of iterations |
|
Could you take a look sometime @dpo. |
There was a problem hiding this comment.
Pull request overview
This pull request addresses issue #270 by adding an upper bound function for operator norms to improve robustness when the quasi-Newton approximation Bₖ (particularly SR1) is ill-conditioned. The PR introduces a new opnorm_upper_bound function with specialized implementations for different operator types, and updates the power_method! function to return a success indicator.
Changes:
- Added
opnorm_upper_boundfunction with specialized implementations for LBFGS, LSR1, diagonal, matrix, and general linear operators - Modified
power_method!to return a tuple(value, found)indicating success - Updated R2N algorithm to use
opnorm_upper_boundwhenopnorm_maxiter ≤ 0 - Added comprehensive tests for the new functionality
- Bumped LinearOperators dependency from 2.10.0 to 2.13.0 to access the
opnorm_upper_boundfield in operator data structures
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils.jl | Implements opnorm_upper_bound functions for various operator types and updates power_method! return signature |
| src/R2N.jl | Updates R2N algorithm to use opnorm_upper_bound and handles new power_method! signature; updates documentation |
| src/TR_alg.jl | Updates to handle new power_method! return signature |
| test/test-utils.jl | Adds comprehensive tests for opnorm_upper_bound across different operator types |
| test/runtests.jl | Includes new test file and adds LinearOperators import |
| Project.toml | Bumps LinearOperators version requirement to 2.13.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Mohamed Laghdaf <81633807+MohamedLaghdafHABIBOULLAH@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
#270 (comment)
@MohamedLaghdafHABIBOULLAH @d1Lab,
Can you fetch my branch and make some benchmarks ? I think we should try to see if it works because it is very cheap.