[SciPy-User] Passing fmin_cg a gradient

Patrick Holvey pholvey at gmail.com
Mon Apr 11 20:52:29 EDT 2011


Hi everybody,

I'm using fmin_cg to minimize atom positions (xyz coordinates) using a
Keating potential (one term for the bond stretching and one for the bond
angle bending).  It's been great but now I'm trying to speed up the
minimization by giving fmin_cg the optional argument of fprime.  I'm coding
up the gradient function now, but I'm not sure what form the vector field is
supposed to be when it returns the vector field to the optimization for
fmin_cg to be happy.

Should the gradient be returned as a list of arrays (since there would be an
xyz magnitude associated with each atom position) or should it be in some
other form that I'm not thinking of?  Does anyone have any experience with
this?  I've tried to figure out what I should be passing from online
examples of fmin_cg usage, but I'm not really seeing examples that are able
to be extended to this problem in a straightforward manner.

I'm also open to alternate optimization calls if anyone has
recommendations.  I've got both an analytic potential and gradient so I do
have an fprime term if the optimization call needs it.  However, I'd
appreciate guidance on what form the gradient function should return since I
don't want to be dealing with a new optimization method and be caught in the
same spot again.

Thanks for any help!

Patrick

-- 
Patrick Holvey
Graduate Student
Dept. of Materials Science and Engineering
Johns Hopkins University
pholvey1 at jhu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110411/e49e0cc1/attachment.html>


More information about the SciPy-User mailing list