OptimistixMinimise

class pmrf.optimize.OptimistixMinimise(solver: AbstractMinimiser, fatol: float = 1e-07)

Bases: AbstractUnconstrainedMinimizer

An optimizer that wraps an arbitrary Optimistix optimistix.AbstractMinimiser.

Adds a function success tolerance to the solver, and also passes throw=False by default to optimistix.minimise().

Parameters:
  • solver (optx.AbstractMinimiser) – The specific optimistix solver instance to use.

  • fatol (float, default=1e-7) – Absolute tolerance of the function value for termination.

run(fn: Callable[[PyTree, Any], Any], y0: PyTree, args: Any, max_iter: int, **kwargs) tuple[MinimizeResult, PyTree]

Execute the minimization algorithm.

Parameters:
  • fn (callable) – The objective function to minimize.

  • y0 (PyTree) – The initial parameter guess.

  • args (Any) – Args to pass to fn.

  • max_iter (int = 1024) – The maximum number of iterations to take.

  • **kwargs – Runtime arguments forward to the solver backend.

Returns:

A tuple of (pmrf.optimize.MinimizeResult, metrics)`.

Return type:

tuple

fatol: float = 1e-07
solver: AbstractMinimiser