[SciPy-User] using fmin_tnc
Jason Rennie
jrennie at gmail.com
Wed May 11 23:03:58 EDT 2011
On Wed, May 11, 2011 at 12:24 PM, Joon Ro <joonpyro at gmail.com> wrote:
> So the documentation does say x0 is a list of floats. I haven't tried it
> but it should work with a one dimensional vector as well. I'm not sure if
> the routine passes x as a list or not to the objective function though.
>
I have tried it, and, yes, it accepts a numpy array. As Joon noted, you
need to flatten your parameters into an array. Consider creating functions
for converting between the two formats (two matrices, single vector). I
typically use a class instance to keep track of the specifications for the
conversion, such as the sizes of the two matrices. l_bfgs_b has a similar
interface and has very smart convergence criterion AFAICT, so if you have
trouble with tnc, try l_bfgs_b (even if your problem is unconstrained).
Cheers,
Jason
--
Jason Rennie
Research Scientist
Google/ITA Software
617-714-2645
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110511/71fc50c4/attachment.html>
More information about the SciPy-User
mailing list