[SciPy-User] cobyla

Sloan Lindsey sloan.lindsey@gmail....
Tue Mar 26 06:09:19 CDT 2013


That's a bummer, it would be nice to see it in a future version.

For anyone who is interested in doing something similar, I ended up
passing a counter variable in the args that is incremented every time
the the fn to be minimized is called. I'm still debugging so I'll let
everyone know if it doesn't work.
-Sloan

On Mon, Mar 25, 2013 at 9:19 PM, Ralf Gommers <ralf.gommers@gmail.com> wrote:
>
>
>
> On Mon, Mar 25, 2013 at 12:55 PM, Sloan Lindsey <sloan.lindsey@gmail.com>
> wrote:
>>
>> How does one parse the doc string? I'm interested in having my script
>> know when MAXFUN is reached. I see it coming out as a print line ( I
>> have to use 0.7.2 because of an older centOS install), but I'd really
>> like my script to know that it has happened so I can tag that solution
>> as suspect. Is there any cute way to redirect that output into
>> something I can parse?
>
>
> I don't think there's a good way to get at it. The output comes from some
> Fortran code, so redirecting sys.stdout won't help you.
>
> Ralf
>
>
>>
>>
>> -Sloan
>>
>> On Mon, Oct 1, 2012 at 9:58 PM, Ralf Gommers <ralf.gommers@gmail.com>
>> wrote:
>> >
>> >
>> > On Sun, Sep 30, 2012 at 11:09 PM, The Helmbolds <helmrp@yahoo.com>
>> > wrote:
>> >>
>> >> On my system (Windows 7, Python 2.7.x and IDLE, latest SciPy), I
>> >> observe
>> >> the following behavior with fmin_cobyla and minimize's COBYLA method.
>> >>
>> >> Case 1: When run either in the IDLE interactive shell or within an
>> >> enclosing Python program:
>> >>     1.1. The fmin_cobyla function never returns the Results dictionary,
>> >> and never displays it to Python's stdout. This is true regardless of
>> >> the
>> >> function call's disp setting.
>> >
>> >
>> > Correct. The fmin_cobyla docstring clearly says what it returns. Result
>> > objects are only returned by the new interfaces in the 0.11.0 release
>> > (minimize, minimize_scalar, root).
>> >
>> >>     1.2. The 'minimize' function always returns the Results dictionary
>> >> but
>> >> never displays it to Python's stdout. Again, this is true regardless of
>> >> the
>> >> function call's disp setting.
>> >
>> >
>> > `disp` doesn't print the Results objects. For me it works as advertized
>> > (in
>> > IPython), it prints something like:
>> >
>> >    Normal return from subroutine COBYLA
>> >
>> >    NFVALS =   37   F = 8.000000E-01    MAXCV = 0.000000E+00
>> >    X = 1.400113E+00   1.700056E+00
>> >
>> > Ralf
>> >
>> >>
>> >> Case 2: When run interactively in Window's Command Prompt box:
>> >>     2.1 The fmin_cobyla function never returns the Result dictionary,
>> >> regardless of the function call's disp setting. Setting disp to True or
>> >> False either displays the Results dictionary in the command box or not
>> >> (respectively). I don't think the Results dictionary gets to the
>> >> command box
>> >> via stdout.
>> >>     2.2 The 'minimize' function always returns the Result dictionary,
>> >> regardless of the function call's disp setting.  Setting disp to True
>> >> or
>> >> False either displays the Results dictionary in the command box or not
>> >> (respectively). I don't think the Results dictionary gets to the
>> >> command box
>> >> via stdout.
>> >>
>> >> My thanks to all who helped clarify this situation.
>> >>
>> >> Bob H
>> >> _______________________________________________
>> >> SciPy-User mailing list
>> >> SciPy-User@scipy.org
>> >> http://mail.scipy.org/mailman/listinfo/scipy-user
>> >
>> >
>> >
>> > _______________________________________________
>> > SciPy-User mailing list
>> > SciPy-User@scipy.org
>> > http://mail.scipy.org/mailman/listinfo/scipy-user
>> >
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-User mailing list