@@ -3920,48 +3920,36 @@ addition to optimagic when using an NLOPT algorithm. To install nlopt run
39203920
39213921optimagic supports the [ IMINUIT MIGRAD Optimizer] ( https://iminuit.readthedocs.io/ ) . To
39223922use MIGRAD, you need to have
3923- [ the iminuit package] ( https://github.com/scikit-hep/iminuit ) installed (pip install
3924- iminuit).
3923+ [ the iminuit package] ( https://github.com/scikit-hep/iminuit ) installed
3924+ ( ` pip install iminuit` ).
39253925
39263926``` {eval-rst}
39273927.. dropdown:: iminuit_migrad
39283928
3929- .. code-block::
3930-
3931- "iminuit_migrad"
3932-
3933- `MIGRAD <https://iminuit.readthedocs.io/en/stable/reference.html#iminuit.Minuit.migrad>`_ is
3934- the workhorse algorithm of the MINUIT optimization suite, which has been widely used in the
3935- high-energy physics community since 1975. The IMINUIT package is a Python interface to the
3936- Minuit2 C++ library developed by CERN.
3929+ **How to use this algorithm:**
39373930
3938- Migrad uses a quasi-Newton method, updating the Hessian matrix iteratively
3939- to guide the optimization. The algorithm adapts dynamically to challenging landscapes
3940- using several key techniques:
3931+ .. code-block::
39413932
3942- - **Quasi-Newton updates**: The Hessian is updated iteratively rather than recalculated at
3943- each step, improving efficiency.
3944- - **Steepest descent fallback**: When the Hessian update fails, Migrad falls back to steepest
3945- descent with line search.
3946- - **Box constraints handling**: Parameters with bounds are transformed internally to ensure
3947- they remain within allowed limits.
3948- - **Heuristics for numerical stability**: Special cases such as flat gradients or singular
3949- Hessians are managed using pre-defined heuristics.
3950- - **Stopping criteria based on Estimated Distance to Minimum (EDM)**: The optimization halts
3951- when the predicted improvement becomes sufficiently small.
3952-
3953- For details see :cite:`JAMES1975343`.
3933+ import optimagic as om
3934+ om.minimize(
3935+ ...,
3936+ algorithm=om.algos.iminuit_migrad(stopping_maxfun=10_000, ...)
3937+ )
3938+
3939+ or
3940+
3941+ .. code-block::
39543942
3955- **Optimizer Parameters:**
3943+ om.minimize(
3944+ ...,
3945+ algorithm="iminuit_migrad",
3946+ algo_options={"stopping_maxfun=10_000, ...}
3947+ )
39563948
3957- - **stopping.maxfun** (int): Maximum number of function evaluations. If reached, the optimization stops
3958- but this is not counted as successful convergence. Function evaluations used for numerical gradient
3959- calculations do not count toward this limit. Default is 1,000,000.
3949+ **Description and available options:**
39603950
3961- - **n_restarts** (int): Number of times to restart the optimizer if convergence is not reached.
3951+ .. autoclass:: optimagic.optimizers.iminuit_migrad.IminuitMigrad
39623952
3963- - A value of 1 (the default) indicates that the optimizer will only run once, disabling the restart feature.
3964- - Values greater than 1 specify the maximum number of restart attempts.
39653953```
39663954
39673955## Nevergrad Optimizers
0 commit comments