- 
                Notifications
    You must be signed in to change notification settings 
- Fork 10
Add option to approximate the operator norm with rayliegh quotients #204
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
Add option to approximate the operator norm with rayliegh quotients #204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have numerical results?
| I am trying to make the tests pass, i will show numerical experiments thereafter. It seems that there is a type instability hidden somewhere, i am investigating | 
| Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@             Coverage Diff             @@
##           master     #204       +/-   ##
===========================================
+ Coverage   61.53%   84.41%   +22.88%     
===========================================
  Files          11       13        +2     
  Lines        1292     1630      +338     
===========================================
+ Hits          795     1376      +581     
+ Misses        497      254      -243     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
| Numerical Experimentyields so that computing the exact norm results in approximately two times less iterations in this case. which returns so that we are two times faster on average. | 
| I ran the same experiment with the L0 norm and the algorithm then fails sometimes if compute_opnorm = false. I am guessing that it is due to the fact that this regularization is not convex. | 
| Thank you @MaxenceGollier for the experiments, I was afraid that the L0 norm will fail because of its instability and we ought to have a good approximation of Bk in order to ensure sufficient decrease, otherwise we might get a negative  | 
| @dpo @MaxenceGollier | 
| I think this needs to be investigated. Convexity should have nothing to do with it. The descent lemma holds for any lsc h. | 
| I agree, I'll look into it in more detail. I think we should consider an easily trackable example rather than BPDN, since it is random and not straightforward to reproduce. Any ideas, @dpo? Perhaps a nontrivial one-dimensional function, like Rosenbrock, where we add the  | 
48419a7    to
    14a511a      
    Compare
  
    | It would be good to try computing several Rayleigh quotients here. | 
14a511a    to
    92597d1      
    Compare
  
    | 
 Done @dpo. | 
| @MaxenceGollier Could you please rebase this branch? I think it would be very useful, especially for the reproducibility of the results. | 
0f0cb5e    to
    22ae7e1      
    Compare
  
    | Interesting, the R2N test with LBFGS and L0 fails here : @MohamedLaghdafHABIBOULLAH is it expected behaviour ? What do you think ? @dpo. I might just increase the default number of iterations by default. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds an option to approximate the operator norm using the power method with Rayleigh quotients instead of relying solely on Arpack. The implementation provides a configurable parameter opnorm_maxiter that controls how many power method iterations to use, with negative values falling back to the original Arpack-based approach.
Key changes:
- Added a new power_method!function that implements the power method algorithm for operator norm approximation
- Modified TR and R2N solvers to support the new opnorm_maxiterparameter and use power method when appropriate
- Updated test allocation checks to include R2N solver and removed TR solver from the test suite
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description | 
|---|---|
| src/utils.jl | Adds the power_method!function implementation | 
| src/TR_alg.jl | Integrates power method option into TR solver with new parameter and vector allocation | 
| src/R2N.jl | Integrates power method option into R2N solver with new parameter and vector allocation | 
| test/test_allocs.jl | Updates allocation tests to include R2N and remove TR solver | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| 
 In general, if  | 
| I see in the log. I guess we didn't stop because of  | 
| No I can not reproduce... We should add a seed in the tests... | 
| @MaxenceGollier @dpo should we move ahead with merging? This PR is a key step to guarantee reproducible and trustworthy results. | 
| In my opinion we can merge @dpo | 
| It would be beneficial to do the same for LM and align it with R2N and TR issue | 
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
a071216    to
    bf1029a      
    Compare
  
    aa0778c
      into
      
  
    JuliaSmoothOptimizers:master
  
    
Partially solves #133
@dpo @MohamedLaghdafHABIBOULLAH