Skip to content

Add a PreconditionedDirection direction rule#444

Merged
kellertuer merged 9 commits intomasterfrom
kellertuer/precondition-rule
Mar 24, 2025
Merged

Add a PreconditionedDirection direction rule#444
kellertuer merged 9 commits intomasterfrom
kellertuer/precondition-rule

Conversation

@kellertuer
Copy link
Copy Markdown
Member

@kellertuer kellertuer commented Mar 21, 2025

This new gradient rule allows to easily precondition the gradient as (preconditioning by 0.5):

gradient_descent(M, f, grad_f, p0;
    direction=PreconditionedDirection((M, p, X) -> 0.5 .* X),
)

or similarly in-place

gradient_descent(M, f, grad_f, p0;
    direction = PreconditionedDirection(
        (M, Y, p, X) -> (Y .= 0.5 .* X);
        evaluation=InplaceEvaluation()
    ),
)

📋

  • add this also as a preconditioner=keyword to quasi newton (conjugate_gradient accepts that as an input already)

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.88%. Comparing base (dd64c48) to head (87f8d8c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #444   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files          80       80           
  Lines        8541     8562   +21     
=======================================
+ Hits         8531     8552   +21     
  Misses         10       10           

☔ 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.

@kellertuer kellertuer changed the title Add a PreconditionGradient direction rule Add a PreconditionedDirection direction rule Mar 21, 2025
@kellertuer kellertuer added enhancement documentation Ready-for-Review A label for pull requests that are feature-ready labels Mar 22, 2025
Comment thread src/plans/gradient_plan.jl Outdated
Comment thread src/solvers/quasi_Newton.jl Outdated
kellertuer and others added 2 commits March 23, 2025 18:54
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
@kellertuer kellertuer merged commit 21ec19d into master Mar 24, 2025
15 of 16 checks passed
@kellertuer kellertuer deleted the kellertuer/precondition-rule branch July 5, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement Ready-for-Review A label for pull requests that are feature-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants