Free Python optimization framework

Tuesday, October 30, 2007

some changes to scipy_bfgs and scipy_ncg

Some changes have been committed to scipy_bfgs and scipy_ncg. Now they handle more stop criteria, and plotting (via p.plot=1) yields point for every iteration, not just 2 points start-finish joined by direct line.

I intend to implement similar changes for ALGENCAN, but since the solver doesn't have iterfcn ability (ALGENCAN developers had been informed about the issue, but no answer have been obtained), I intend to connect iterfcn to df (gradient) (OO numerical gradient will be used if no user-supplied one will be available).

Monday, October 29, 2007

some more scipy NLSP solvers have been connected

I have connected some more NLSP solvers from scipy, however, all they works very unstable and can't use derivatives (at least for current scipy version 0.6.0, maybe in future they will be enhanced by someone).
So the new solvers are
you can read more about the ones (particularly, algorithms used) here.

Saturday, October 27, 2007

Elefant solvers

Some months ago I got to know about the Elefant package, it contains some optimization routines that could be useful for OO (although, I haven't start to connect Elefant solvers yet).

However, their API seems to be very strange, for example:

minimize (c, x)
subject to b ≤ Ax ≤ b + d and l ≤ x ≤ u:
mysolver = intpointsolver.CLPSolver()
x, y, how = mysolver.Solve( c, A, b, r, l, u)

minimize 0.5*(x, Hx) + (c, x)
subject to b ≤ Ax ≤ b + d and l ≤ x ≤ u :
mysolver = intpointsolver.CLPSolver()
x, y, how = mysolver.Solve( c, H, A, b, r, l, u)
So I can't understand how should I implement those linear inequalities b ≤ Ax ≤ b + d where lower or upper coordinate is +/- inf (btw a small bug is using 'd' literal instead of 'r' or wise versa). I hadn't get any explanations from Elefant documentation.
Ok, maybe for [a, +inf) bounds they mean using d (that is r) = inf, but how should I handle (-inf, a] bounds?

Maybe Elefant developers will fix the issue.

IronPython and NumPy

IronPython users, here is an information about using numpy (from IronPython), I guess it could be useful for you.

Let me remember you once again: the only one dependence for OpenOpt is NumPy.

Friday, October 26, 2007

d2f: 2nd derivatives

I have connected another one unconstrained scipy.optimize solver: fmin_ncg.
This one can handle Hesse matrix (objFunc 2nd derivatives), see the example for more details.
Also, some changes were made to scipy_bfgs, now the solver (along with scipy_ncg) handles more user-supplied stop criteria passed from OpenOpt API. Also, graphic output for scipy_bfgs is no just 2 points connected by direct line, now it's similar to output of lincher or ralg; same to scipy_ncg.
Some of my primary goals are using d2c, d2h, d2l in ALGENCAN and/or CVXOPT and/or other OO NLP solvers, but I guess it will take much time, I'm short of the one for now.

Wednesday, October 24, 2007

some minor bugfixes

3 minor bugs have been fixed (svn and have been updated).
1. OpenOpt required pylab (matplotlib) installed for problems with p.plot turned off as well.
2. p.check.df didn't work with LSP and NLSP.
3. Some code related to GNLP and LLSP were not committed into svn (those who had downloaded OpenOpt from didn't encountered any problems).

Friday, October 19, 2007

LLSP: linear least squares problem

New OO class have been created:
LLSP - Linear Least Squares Problem.
2 solvers are connected for now: lapack_dgelss and lapack_sgelss (double and single precision). Requires LAPACK and scipy.
A simple example is provided.

Already available in svn and!

P.S. As I had been informed by developers of dgelss/sgelss, they have more powerful routines: dgelsa and dgelsb, available at  ->  Software Efforts  -> LS Library
However, they are not included in LAPACK yet.

Sunday, October 14, 2007

Some changes

Yestorday I committed to svn a small bug, so all check of 1st derivatives dc and dh always yield zero difference. Today I have fixed the bug.
DFP (data fit) class have been renamed to LSP (least squares), this is much more correct both for single solver (scipy_leastsq) and for usage. Maybe I will implement DFP later.
Some changes have been made in OO website.

Saturday, October 13, 2007

Visitors statistic

I have added new OpenOpt site web page - visitors statistic.
So for now 51% of browsers are Firefox 1.x. I guess it's one more prove that some visitors remain uncounted due to my asp-based web counter. I hope Jeff Strunk will implement more advanced, javascript-based counter soon (currently javascript is turned off in the Trac settings).

Friday, October 12, 2007

ALGENCAN output files

Maybe some of you had already noticed that ALGENCAN yields 4 files:
algencan-tabline.out, gencan-tabline.out, algencan.out, solution.txt
As I have been informed by
ALGENCAN developers, currently the only one way to prevent creating these files is removing all those lines 'write(10' in algencan.f, recompiling and reinstalling ALGENCAN.
I hope the problem will have more convenient solution in next ALGENCAN releases.

Wednesday, October 10, 2007

Additional user args usage

I have committed an example of using user-supplied additional arguments for f, c, h functions.
See the example here.
(Updating OpenOpt from svn or is required)

Tuesday, October 9, 2007

Bug in voting have been fixed

So now you can vote.

Also, I noticed some web browsers (IE, Opera) are blocking my asp-based visiting counter (by default or by user settings), so some visitors remain uncounted.

I will try to find other counter, not asp-based, that will take into account more site visitors.

Saturday, October 6, 2007

DFP: Data Fit Problem

New OO class have been created:
DFP - Data Fit Problem (non-linear)
currently the only one solver is scipy.optimize.leastsq as scipy_leastsq
see example here