Skip to content

Reorganization#63

Merged
denehoffman merged 4 commits intomainfrom
overhaul
Apr 1, 2025
Merged

Reorganization#63
denehoffman merged 4 commits intomainfrom
overhaul

Conversation

@denehoffman
Copy link
Copy Markdown
Owner

Now that I have a better sense of what I'm doing here, it's time to make this crate a bit more organized. I've reverted the tuning method that was added in the previous patch, it's fairly useless as far as I can tell. The biggest update here is that bounds are separated from the minimizer/sampler structures. Instead, algorithms which support bounds should store them in the algorithm initialization, and algorithms which don't can always take a BoundedFunction wrapper which does the bounds transformation implicitly.

There is still some work that needs to be done to fully decouple these, for example the NelderMead algorithm still uses bounds in places outside function evaluations. There should probably be some closer coupling between Bound and Point, but I'll figure that out later.

These are basically less-useful versions of L-BFGS-B
…rithms

Rather than Bounds being explicitly given when the minimizer is created, they are now part of the function, except in the cases of algorithms which support bounds, in which case they are part of the algorithm. This distinguishes the act of transforming functions to make them bounded and using a algorithm that supports bounding standard functions. A wrapper struct, `BoundedFunction`, is provided to handle the former case.

This also moves tolerances out of terminators and into the main algorithm structs, which is mostly aesthetic but also gets around a few annoyances in coding.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 33.69963% with 362 lines in your changes missing coverage. Please review.

Project coverage is 50.53%. Comparing base (d44cde5) to head (0409609).

Files with missing lines Patch % Lines
src/lib.rs 17.23% 317 Missing ⚠️
src/algorithms/nelder_mead.rs 70.00% 27 Missing ⚠️
src/algorithms/lbfgsb.rs 77.19% 13 Missing ⚠️
src/algorithms/line_search.rs 73.33% 4 Missing ⚠️
src/samplers/aies.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
- Coverage   54.73%   50.53%   -4.21%     
==========================================
  Files          12        8       -4     
  Lines        2585     2145     -440     
==========================================
- Hits         1415     1084     -331     
+ Misses       1170     1061     -109     

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 1, 2025

CodSpeed Performance Report

Merging #63 will improve performances by 10.61%

Comparing overhaul (0409609) with main (d44cde5)

Summary

⚡ 3 improvements
✅ 9 untouched benchmarks
⁉️ 8 (👁 8) dropped benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
👁 Rosenbrock[2] 51 ms N/A N/A
👁 Rosenbrock[3] 26 ms N/A N/A
👁 Rosenbrock[4] 46.7 ms N/A N/A
👁 Rosenbrock[5] 10.3 ms N/A N/A
👁 Rosenbrock[2] 148.1 µs N/A N/A
👁 Rosenbrock[3] 250.1 µs N/A N/A
👁 Rosenbrock[4] 275.5 µs N/A N/A
👁 Rosenbrock[5] 445 µs N/A N/A
Rosenbrock (adaptive)[2] 123.4 µs 111.6 µs +10.61%
Rosenbrock (adaptive)[3] 295.1 µs 268 µs +10.11%
Rosenbrock[2] 123.1 µs 111.3 µs +10.59%

@denehoffman denehoffman merged commit 2c2abcf into main Apr 1, 2025
5 of 7 checks passed
@denehoffman denehoffman deleted the overhaul branch April 1, 2025 23:21
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.

1 participant