Skip to content

implementation Line Search with Negative Curvature Detection with direction for CR #985

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

farhadrclass
Copy link
Contributor

The algorithm adapts its behavior upon detecting nonpositive curvature:

At iteration k = 0: Returns the right-hand side b with solver.npc_dir set to the preconditioned initial residual.

At iteration k > 0: Returns the solution from iteration k-1 with solver.npc_dir updated to the most recent residual.

This modification ensures that the CR algorithm can be effectively utilized within inexact Newton methods that employ a linesearch strategy.

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 83.18584% with 19 lines in your changes missing coverage. Please review.

Project coverage is 97.48%. Comparing base (9536ef7) to head (711eab0).
Report is 80 commits behind head on main.

Files with missing lines Patch % Lines
src/cr.jl 63.46% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #985      +/-   ##
==========================================
+ Coverage   94.68%   97.48%   +2.80%     
==========================================
  Files          45       49       +4     
  Lines        8027     9347    +1320     
==========================================
+ Hits         7600     9112    +1512     
+ Misses        427      235     -192     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@farhadrclass
Copy link
Contributor Author

@dpo I’ve updated the PR.

I introduced num_dir in stats to indicate how many negative-curvature directions we’re using. However, I’m not entirely confident in the approach or whether I placed everything correctly (some lines are marked with #TODO). Would you be able to take a look now so I can finalize it and then write the test cases?

The idea is that we can detect 0, 1, or 2 negative directions. npc_dir is set to either r or p, and if both directions are needed, we use solver.p as well.

Let me know what you think!

@farhadrclass farhadrclass force-pushed the CR_linesearch_neg_curv branch from bf3d347 to 71ccf69 Compare May 10, 2025 14:38
farhadrclass and others added 2 commits May 10, 2025 10:39
Co-authored-by: Dominique <dominique.orban@gmail.com>
farhadrclass and others added 7 commits May 12, 2025 16:50
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
Co-authored-by: Dominique <dominique.orban@gmail.com>
@farhadrclass
Copy link
Contributor Author

added npc_dir logic for when radius > 0 and nonpositive curvature is detected, the behavior depends on the iteration and follow similar logic as linesearch;

@farhadrclass farhadrclass requested a review from dpo May 14, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants