[SciPy-User] optimize.fmin_cg terminates when w - grad*1e-10 yields lower obj & grad
Jason Rennie
jrennie@gmail....
Tue Oct 6 16:05:30 CDT 2009
Good idea re: the test case. Please find one attached. I am fairly certain
that this provides a solid, self-contained, relatively-simple test case that
breaks CG. But let me know if anyone finds otherwise and I'm happy to try
to help tweak to make it a solid test cases. I'm guessing that larger
values of self.n and self.d would provide additional good tests. FYI, I
threw in cases for BFGS and L-BFGS and found that they break too, but I
didn't investigate.
Re: amin. My read of the code is that linesearch.py tells minpack2.dcsrch
to give up if it can't find a satisfactory step-size >= amin. Does anyone
understand the rationale behind this setting? I noticed in the svn logs
that it was changed from 1e-6 to 1e-8 at some point.
Jason
On Mon, Oct 5, 2009 at 9:50 PM, <josef.pktd@gmail.com> wrote:
> Do you have a test case? What I have seen in the optimize.tests is only one
> case for fmin_cg, which looks similar to your case
> objective function
> log_pdot = dot(self.F, x)
> logZ = log(sum(exp(log_pdot)))
> f = logZ - dot(self.K, x)
>
> but might have well behaved parameterization.
>
> If you can write a test case that works on the limit of the current
> precision,
> we could include it in the test suite. The same optimization problem is
> used to test several minimizers, so this could also check whether any of
> the other ones is able to handle this problem.
> If zoom is also buggy, more work and a failing test case will be required
> to
> find and correct the bug.
>
> For your other comments, I don't know enough about fmin_cg.
> amin=1e-12 Could this be a problem if the numerical precision of
> the objective function and the gradient are not high enough?
>
> If you have a better cg algorithm or one that works better for some
> cases, you could propose it for inclusion in scipy.
>
> Thanks for filing the ticket.
>
> Josef
--
Jason Rennie
Research Scientist, ITA Software
617-714-2645
http://www.itasoftware.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091006/83612dec/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scipycgtest.py
Type: text/x-python
Size: 3301 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20091006/83612dec/attachment.py
More information about the SciPy-User
mailing list