[Python-modules-team] Bug#778635: python-scipy bundles library for L-BFGS-B minimization

Gard Spreemann gspreemann at gmail.com
Tue Apr 2 11:48:56 BST 2019

On Fri, Mar 29, 2019 at 7:03 AM Drew Parsons <dparsons at debian.org> wrote:
> Hi Gard, can you provide a simple test script so we can confirm that
> scipy works correctly after applying your L-BFGS-B patch?


Attached is an improved patch, superseding the previous ones, for
using Debian's system LBFGSB library (build-depend on liblbfgsb-dev).

The patch can be tested with something like:

 from scipy.optimize import fmin_l_bfgs_b, rosen

 x0 = [0.2, -0.2, 0.1, -0.1]
 res = fmin_l_bfgs_b(rosen, x0, approx_grad=True, factr=10)
 print("Unbounded minimum:")

 res = fmin_l_bfgs_b(rosen, x0, approx_grad=True, factr=10,
bounds=len(x0)*[(-0.5, 0.5)])
 print("Bounded minimum:")

One can then compare the two outputs produced with the patch with the
ones produced without it.

The results may differ very slightly because the system LBFGSB uses LAPACK,
while the SciPy-bundled one uses LINPACK.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-Use-system-LBFGSB.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20190402/7619a314/attachment-0001.bin>

More information about the Python-modules-team mailing list