Limit computation time of optimization algorithms in python

When using optimization algorithms in Python such as scipy.optimize.minimize () from the Scipy library, you can specify the maximum number of iterations via the optional "maxiter" argument. However, I would like to limit the total computation time of this algorithm, since I would like to use it in a time critical application. The number of iterations is secondary.

Is there a way to limit the maximum computation time in the Scipy optimization functions? If that means the result is less accurate, that's fine.

+3


source to share





All Articles