Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not print "optimization terminated successfully" scipy.optimize.fmin?

Tags:

python

scipy

Is there a way to "quietly" use scipy.optimize.fmin? That is, that it does not print e.g.

Optimization terminated successfully.
        Current function value: 0.000000
        Iterations: 13
        Function evaluations: 30

when running the code?

This could be useful in e.g. loops that last a for a while.

like image 593
user3218615 Avatar asked Mar 11 '14 16:03

user3218615


People also ask

What is FMIN in Python?

fmin() function is used to compute element-wise minimum of array elements. This function compare two arrays and returns a new array containing the element-wise minima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned.

What does Scipy optimize return?

Objective functions in scipy. optimize expect a numpy array as their first parameter which is to be optimized and must return a float value. The exact calling signature must be f(x, *args) where x represents a numpy array and args a tuple of additional arguments supplied to the objective function.


1 Answers

Setting the argument disp=False stops scipy.optimize.fmin from printing messages.

like image 76
timrau Avatar answered Nov 15 '22 14:11

timrau