[Python] How do I interpret scipy.optimize.minimize convergence metrics? Specifically, nit,...

Discussão em 'Python' iniciado por Stack, Março 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am solving an constrained, nonlinear optimization problem with scipy.optimize.minimize using the SLSQP solver. The optimization converges properly, but I want to have a better understanding of how to interpret the OptimizeResult output, specifically nit, nfev, and njev. Scipy documentation defines them as the following:

    • nit: Number of iterations performed by the optimizer.
    • nfev, njev: Number of evaluations of the objective functions and of its Jacobian

    And here is an example output from the optimizer which I would like to understand:

    ----------------------------------------
    message: Optimization terminated successfully
    success: True
    status: 0
    fun: -0.2498255944127068
    x: [ 6.087e-02 7.000e-02 7.000e-02 7.000e-02 7.000e-02
    7.000e-02 7.000e-02 7.000e-02]
    nit: 6
    jac: [-4.197e-02 -8.534e-02 -2.353e-02 -1.421e-02 -8.549e-02
    -5.721e-02 -1.725e-02 -4.846e-03]
    nfev: 54
    njev: 6


    My questions are:

    • Why are there far more function evaluations than Jacobian evaluations? From my understanding, there should be a Jacobian evaluation with each update step.
    • Do these convergence metrics give any indication of how stable this solution is, or how quickly it converged?
    • In general, what can I learn about my optimization problem from these metrics alone, and what else may I have to dive deeper into in order to understand the objective landscape?

    Continue reading...

Compartilhe esta Página