Skip to content

Use BFGS as default in optimization for function space operators - #416

Merged
ranocha merged 2 commits into
ranocha:mainfrom
JoshuaLampert:default-opt-alg-fsbp
May 30, 2026
Merged

Use BFGS as default in optimization for function space operators#416
ranocha merged 2 commits into
ranocha:mainfrom
JoshuaLampert:default-opt-alg-fsbp

Conversation

@JoshuaLampert

Copy link
Copy Markdown
Contributor

As discussed in #415 (I also noticed this already some time ago, but never updated the default here), BFGS usually performs better than LBFGS for us at least for the smaller to medium size problems. In the tests it usually converges faster than LBFGS both in terms of iteration count and function evaluations, it runs also faster, and usually often even converges to a slightly smaller minimum. The latter even allows us to use slightly tighter tolerances in the tests.
I did not change the default linesearch algorithm because for BFGS the difference between them is not as strong as for LBFGS and it would require us to put LineSearches.jl into the extension (we could do that because it would automatically be loaded since Optim.jl loads it, but IMO it would not be so nice).
Since this feature is marked as experimental

!!! warning "Experimental implementation"
This is an experimental feature and may change in future releases.

I think it is fine to change the default.

Closes #415.

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.09%. Comparing base (ede5990) to head (a3aa3ef).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #416   +/-   ##
=======================================
  Coverage   93.09%   93.09%           
=======================================
  Files          42       42           
  Lines        6807     6807           
=======================================
  Hits         6337     6337           
  Misses        470      470           
Flag Coverage Δ
unittests 93.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.088%. remained the same — JoshuaLampert:default-opt-alg-fsbp into ranocha:main

@ranocha ranocha left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@ranocha
ranocha merged commit d6551fc into ranocha:main May 30, 2026
22 checks passed
@JoshuaLampert
JoshuaLampert deleted the default-opt-alg-fsbp branch May 30, 2026 08:50
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.

Choice of optimizer

3 participants