[SciPy-user] (no subject)
Jose Lopez
lopmart at gmail.com
Wed Jun 18 05:29:02 EDT 2008
Hi, my code is the next and i have a error, but i not know what i do:
from pylab import *
from scipy import *
def func(b,Hder):
return (Hder[0]-(b[0]-b[1]))**2 + (Hder[1]-(b[1]-b[2]))**2+
(Hder[2]-(b[2]-b[3]))**2+ (Hder[3]-(b[3]-100.0))**2
b0=[0.0,0.0,0.0,0.0]
H0=[0.0,-50.0,20.0,-20.0]
xopt =optimize.fmin_l_bfgs_b(func,b0,args=(H0))
error is
Traceback (most recent call last):
File "C:/Users/Valeria2/JL-MAESTRIA/programas 3
avance/resultado2/pruebafmin_l.py", line 13, in <module>
xopt =optimize.fmin_l_bfgs_b(funcion,b0,args=(H0))
File "C:\Python25\Lib\site-packages\scipy\optimize\lbfgsb.py", line 205,
in fmin_l_bfgs_b
f, g = func_and_grad(x)
File "C:\Python25\Lib\site-packages\scipy\optimize\lbfgsb.py", line 156,
in func_and_grad
f, g = func(x, *args)
TypeError: funcion() takes exactly 2 arguments (5 given)
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20080618/1e130899/attachment.html>
More information about the SciPy-User
mailing list