import scipy.optimizebanana = lambda x: 100*(x[1]-x[0]**2)**2+(1-x[0])**2xopt = scipy.optimize.fmin(func=banana, x0=[-1.2,1])
输出:
Optimization terminated successfully. Current function value: 0.000000 Iterations: 85 Function evaluations: 159array([ 1.00002202, 1.00004222])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)