Free Python optimization framework

Saturday, November 15, 2008

enhanced iterfcn connection for scipy fmin_cobyla

I have connected changes related to handling of scipy_cobyla iterfcn, so now instead of direct line (as before) it looks like this:

Of course, adequate text output is provided as well:

solver: scipy_cobyla problem: unnamed goal: minimum
iter objFunVal log10(maxResidual)
0 6.115e+01 2.13
10 2.015e+01 -2.82
20 2.029e+01 -6.46
30 2.030e+01 -7.60
40 2.032e+01 -8.70
50 2.032e+01 -10.30
60 2.033e+01 -9.78
70 2.033e+01 -13.41
80 2.033e+01 -15.58
90 2.033e+01 -12.50
96 2.033e+01 -21.03
istop: 1000
Solver: Time Elapsed = 0.72 CPU Time Elapsed = 0.69
Plotting: Time Elapsed = 6.72 CPU Time Elapsed = 5.31
objFunValue: 20.329368 (feasible, max constraint = 9.3314e-22)

Also, fEnough, maxTime, maxCPUTime and some other stop criteria work (for scipy_cobyla).

Initially users had to connect iterfcn by themselves (to df, dc, dh etc), then it had been done automatically by default to df, now (with latest changes) it is for f and df only and automatically.

Now NLP instance has parameter f_iter (default is max(nVars,4)), so when number of called objective function exceeds p.f_iter (for scipy_cobyla and other solvers w/o iterfcn connected and gradient using), OO iterfcn function is called (and hence user-supplied callback functions(s) if any are declared).

Also, for those solvers who hasn't native connection to OO iterfcn and use derivatives (algencan, ipopt, scipy_slsqp, some unconstrained and box-bounded ones) there is parameter df_iter, default True (use iterfcn each call for df); if positive integer s(s>1, 1 is same to default True) - use iterfcn each s-th objective function gradient call.

Mb I'll change "f_iter" and "df_iter" to more appropriate field names till next OO release.

No comments: