Skip to content

Fides optimizer: clarify use of Hessian and FIM#1706

Open
dilpath wants to merge 4 commits intodevelopfrom
fix_fides_has_hess
Open

Fides optimizer: clarify use of Hessian and FIM#1706
dilpath wants to merge 4 commits intodevelopfrom
fix_fides_has_hess

Conversation

@dilpath
Copy link
Copy Markdown
Member

@dilpath dilpath commented Mar 31, 2026

Currently it looks like a user needs to specify pypesto.optimize.FidesOptimizer(..., hessian_update=None) to ensure Fides uses the provided Hessian. It appears that default behavior does not use the Hessian from the objective when possible.

@dilpath dilpath requested a review from FFroehlich March 31, 2026 06:35
@dilpath dilpath requested a review from PaulJonasJost as a code owner March 31, 2026 06:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 31, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.81%. Comparing base (f0d3f39) to head (9eedf62).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1706      +/-   ##
===========================================
- Coverage    83.84%   83.81%   -0.04%     
===========================================
  Files          164      164              
  Lines        14345    14346       +1     
===========================================
- Hits         12028    12024       -4     
- Misses        2317     2322       +5     

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

@FFroehlich
Copy link
Copy Markdown
Contributor

from what I recall fides.HybridFixed() initially uses the provided Hessian approximation and then switches to BFGS after a fixed number of iterations. Based on the benchmarking I did back then, this is a reasonable default for FIM approximations, which is likely what most users would work with.

@dweindl
Copy link
Copy Markdown
Member

dweindl commented Mar 31, 2026

At least in the current (develop) version, the docstring doesn't match the implementation:

hessian_update:
Hessian update strategy. If this is ``None``, a hybrid approximation
that switches from the ``problem.objective`` provided Hessian (
approximation) to a BFGS approximation will be used.

hessian_update=None would use the provided Hessian, not the hybrid scheme.

@dilpath dilpath closed this Mar 31, 2026
@dilpath dilpath force-pushed the fix_fides_has_hess branch from e07e18c to 86a0076 Compare March 31, 2026 11:34
@dilpath dilpath reopened this Mar 31, 2026
@dilpath
Copy link
Copy Markdown
Member Author

dilpath commented Mar 31, 2026

Thanks for the feedback -- I tried to resolve this by changing some docstrings.

Copy link
Copy Markdown
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Thanks for this 🙏🏼

)
_hessian_update = fides.BFGS()
else:
warnings.warn(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I find it puzzling that we print a warning in a default setting. Rather a debug? (unless we expect the user to set a value usually)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, done now (also for the old warning). I also updated the docstring again to make explicit the assumption that the problem objective is actually the FIM.

@dilpath dilpath changed the base branch from main to develop April 4, 2026 04:05
@dilpath dilpath changed the title Fides optimizer: use Hessian if provided Fides optimizer: clarify use of Hessian and FIM Apr 4, 2026
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.

5 participants