Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions pypesto/optimize/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1700,9 +1700,15 @@ def __init__(
Optimizer options. See :meth:`fides.minimize.Optimizer.minimize`
and :class:`fides.constants.Options` for details.
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 strategy. Defaults to a BFGS approximation if
``problem.objective`` does not provide a Hessian. Otherwise, it is
assumed that the ``problem.objective`` Hessian is actually the
Fisher information matrix (FIM), and hence a Hessian approximation
strategy is the default, which uses the FIM initially but switches
to BFGS during later iterations.
If your ``problem.objective`` Hessian is actually the Hessian,
then use ``None`` to have Fides use the ``problem.objective``
Hessian for all iterations.
"""
super().__init__()

Expand Down Expand Up @@ -1762,15 +1768,23 @@ def minimize(

if self.hessian_update == "default":
if not problem.objective.has_hess:
warnings.warn(
logger.debug(
"Fides is using BFGS as hessian approximation, "
"as the problem does not provide a Hessian. "
"Specify a Hessian to use a more efficient "
"hybrid approximation scheme.",
"Specify a Hessian (or Fisher information matrix, to use "
"a more efficient hybrid approximation scheme. See the "
"docstring for `hessian_update` in the class constructor "
"for more details.",
stacklevel=1,
)
_hessian_update = fides.BFGS()
else:
logger.debug(
"A hybrid Hessian approximation strategy will be "
"employed. See the docstring for `hessian_update` in "
"the class constructor for more details.",
stacklevel=1,
)
_hessian_update = fides.HybridFixed()
else:
_hessian_update = self.hessian_update
Expand Down
Loading