[SciPy-user] optimize.fmin_bfgs only returning a scalar for xopt?

Nils Wagner nwagner at iam.uni-stuttgart.de
Thu Apr 3 15:30:17 EDT 2008


On Thu, 3 Apr 2008 15:21:27 -0400
  David Warde-Farley <dwf at cs.toronto.edu> wrote:
> Hi folks,
> 
> I just checked out a fresh copy of scipy this morning 
>and I'm having  
> an odd problem with optimize.fmin_bfgs (and actually 
>fmin_cg too).
> 
> Namely, the function I give it (and the initial guess) 
>use 1d-array  
> arguments of length > 1, but I only get a scalar back 
>(specifically a  
> numpy.float64) in the first tuple position, which, if 
>I'm reading the  
> docs right, should contain the value of x that minimizes 
>the function  
> you provided.
> 
> This happens whether or not I supply a gradient 
>function.   
>Furthermore, my objective function actually raises an 
>exception if  
> it's called with a scalar arg instead of an array of the 
>right length.
> 
> Is this a bug? Can anyone confirm this behaviour in 
>r4076? Or am I  
> doing it wrong?
> 
> Thanks,
> 
> David
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user

  
Can you provide us with your example code ?

Nils



More information about the SciPy-User mailing list