Hej chce znalezc arguumenty minimalizujace dana funkcje. Niestety funkcja
scipy.optimize.fmin_l_bfgs_b
wyrzuca blad i nie wiem jak go naprawic
def Kou_calibration_full():
i=0
global opt
mybounds=((0.10,0.31, 0.1),(0.01,2.3, 0.5), (0.1,0.72,0.2), (1.1,2,4),(0.1,2,4))
p0 = spo.brute(Kou_error_function, ranges=mybounds, finish=None)
opt,a,b = spo.fmin_l_bfgs_b(Kou_error_function, p0,bounds=mybounds, approx_grad=True )
return opt
<ipython-input-73-d6642061f0de> in Kou_calibration_full()
4 mybounds=((0.10,0.31, 0.1),(0.01,2.3, 0.5), (0.1,0.72,0.2), (1.1,2,4),(0.1,2,4))
5 p0 = spo.brute(Kou_error_function, ranges=mybounds, finish=None)
----> 6 opt,a,b = spo.fmin_l_bfgs_b(Kou_error_function, p0,bounds=mybounds, approx_grad=True )
7 return opt
~\anaconda3\lib\site-packages\scipy\optimize\lbfgsb.py in fmin_l_bfgs_b(func, x0, fprime, args, approx_grad, bounds, m, factr, pgtol, epsilon, iprint, maxfun, maxiter, disp, callback, maxls)
195 'maxls': maxls}
196
--> 197 res = _minimize_lbfgsb(fun, x0, args=args, jac=jac, bounds=bounds,
198 **opts)
199 d = {'grad': res['jac'],
~\anaconda3\lib\site-packages\scipy\optimize\lbfgsb.py in _minimize_lbfgsb(fun, x0, args, jac, bounds, disp, maxcor, ftol, gtol, eps, maxfun, maxiter, iprint, callback, maxls, finite_diff_rel_step, **unknown_options)
285
286 # unbounded variables must use None, not +-inf, for optimizer to work properly
--> 287 bounds = [(None if l == -np.inf else l, None if u == np.inf else u) for l, u in bounds]
288 # LBFGSB is sent 'old-style' bounds, 'new-style' bounds are required by
289 # approx_derivative and ScalarFunction
~\anaconda3\lib\site-packages\scipy\optimize\lbfgsb.py in <listcomp>(.0)
285
286 # unbounded variables must use None, not +-inf, for optimizer to work properly
--> 287 bounds = [(None if l == -np.inf else l, None if u == np.inf else u) for l, u in bounds]
288 # LBFGSB is sent 'old-style' bounds, 'new-style' bounds are required by
289 # approx_derivative and ScalarFunction
ValueError: too many values to unpack (expected 2)```