Skip to content
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

fdfitter: Improve inversion performance (Friday afternoon) #558

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JoepVanlier
Copy link
Member

Model inversion can be pretty slow and generally, it is cumbersome to have to specify the inversion bounds.

This draft fixes both these issues by introducing a new inversion mode that does simple rootfinding to find the outer extents of the to-be-inverted range. As a fallback method, we fall back to the old method of using least_squares to invert the function.

Differences with the old method:

  • Default bounds make sense for F, d models. While arguably, this makes the Fitter less general, it these bounds do hold for any sort of F, d model you'd throw at it (positive only).
  • Twistable wlc makes use of the rootfinding method (I'd say this is optional, we might hold off on this until 2.0, since technically, it is breaking, but only by a very small amount).
  • Small bugfix in the bounds of the interpolation method.
  • Pass a method flag instead of interpolate=True.

@JoepVanlier JoepVanlier changed the title fdfitter: Improve inversion performance fdfitter: Improve inversion performance (Friday afteroon) Aug 15, 2023
@JoepVanlier JoepVanlier changed the title fdfitter: Improve inversion performance (Friday afteroon) fdfitter: Improve inversion performance (Friday afternoon) Aug 17, 2023
@JoepVanlier JoepVanlier force-pushed the faster_fd branch 3 times, most recently from 6ec258a to d1854f6 Compare November 9, 2023 10:30
@JoepVanlier JoepVanlier force-pushed the faster_fd branch 2 times, most recently from 216eb25 to 09224bc Compare February 1, 2024 18:48
we didn't include the entire independent range, resulting in an interpolant that covered less of the range than desired
has a fallback chute for when bracketing fails
At f_min = 0, numerical difficulties ensue. Considering that the model isn't valid in this range to begin with, we limit the minimum.
It is no longer needed to explicitly provide finite inversion limits. We will only use the interpolation method in the range where our data lives, and outside we always use explicit optimization.
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