[SciPy-User] [SciPy-user] optimize fmin_cg parameter passing

肖智博 (Zhibo Xiao) / Sean zhibo.xiao@gmail....
Sat Apr 14 19:33:13 CDT 2012


Hi,

Thank you for your replies, it seems everyone's answer works and I will
look into them all.

On Fri, Apr 13, 2012 at 22:19, Skipper Seabold <jsseabold@gmail.com> wrote:

> On Fri, Apr 13, 2012 at 1:37 AM, aurora1625 <zhibo.xiao@gmail.com> wrote:
> >
> > Hi, everyone
> >
> > I am new to Python and Scipy and I met a problem when trying to optimize
> a
> > function.
> >
> > My problem is:
> >
> > my f function has several parameters(datatype:array), it's like
> >
> > f = \sum lambda_i * phi_i + \zeta *(exp(lambda_i + \nu_i))
> >
> > this function is about lambda, so i get
> >
> > fprime = \sum phi_i + \zeta *(exp(lambda_i + \nu_i))
> >
> > I want to pass in an initial lambda value, but how can I pass in other
> > parameter, phi, zeta and nu.
> >
> > I guess my function is about lambda, and the other parameters should be
> > constant and fixed, but I really don't know how to pass them in.
> >
>
> Use the args keyword for this. From the docstring of fmin_cg
>
> args : tuple, optional
>    Extra arguments passed to f and fprime.
>
> Skipper
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120415/25500988/attachment.html 


More information about the SciPy-User mailing list