GithubHelp home page GithubHelp logo

pylbfgs's Introduction

PyLBFGS

This is a Python wrapper around Naoaki Okazaki (chokkan)'s liblbfgs library of quasi-Newton optimization routines (limited memory BFGS and OWL-QN).

This package aims to provide a cleaner interface to the LBFGS algorithm than is currently available in SciPy, and to provide the OWL-QN algorithm to Python users.

To build PyLBFGS, run python setup.py build_ext.

Installing

PyLBFGS is written in Cython and requires setuptools, NumPy, liblbfgs and a relatively recent Cython compiler to build (tested with 0.15.1).

Type:

python setup.py install

(optionally prefixed with sudo) to build and install PyLBFGS.

Hacking

Type:

python setup.py build_ext -i

to build PyLBFGS in-place, i.e. without installing it.

To run the test suite, make sure you have Nose installed, and type:

nosetests tests/

Authors

PyLBFGS was written by Lars Buitinck.

Alexis Mignon submitted a patch for error handling.

pylbfgs's People

Contributors

alexis-mignon avatar fgregg avatar larsmans avatar lucastheis avatar vene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pylbfgs's Issues

Exceptions in callbacks are not handled properly

Exceptions occurring in the evaluation or progress reporting callbacks currently cause a print to stderr and an LBFGSError because the wrong value is returned from the callback:

Exception UnboundLocalError: "local variable 'f_calls' referenced before assignment" in 'lbfgs._lowlevel.call_eval' ignored

The exception should be passed up instead.

Build errors

Building using python setup.py build_ext -i failed with the following errors.

running build_ext
skipping 'lbfgs/_lowlevel.c' Cython extension (up-to-date)
building 'lbfgs._lowlevel' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/rtaylor/Desktop/test/venv3/lib/python3.5/site-packages/numpy/core/include -Iliblbfgs -I/usr/include/python3.5m -I/home/rtaylor/Desktop/test/venv3/include/python3.5m -c lbfgs/_lowlevel.c -o build/temp.linux-x86_64-3.5/lbfgs/_lowlevel.o
In file included from /home/rtaylor/Desktop/test/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
from /home/rtaylor/Desktop/test/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/rtaylor/Desktop/test/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from lbfgs/_lowlevel.c:266:
/home/rtaylor/Desktop/test/venv3/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
lbfgs/_lowlevel.c:1072:75: warning: ‘enum LineSearchAlgo’ declared inside parameter list
CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__LineSearchAlgo(enum LineSearchA
^
lbfgs/_lowlevel.c:1072:75: warning: its scope is only this definition or declaration, which is probably not what you want
lbfgs/_lowlevel.c:1075:71: warning: ‘enum ReturnCode’ declared inside parameter list
atic CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ReturnCode(enum ReturnCode
^
lbfgs/_lowlevel.c: In function ‘PyInit__lowlevel’:
lbfgs/_lowlevel.c:6887:53: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__LineSearchAlgo(LBFGS_LINESEARCH_DEFAULT);
^
lbfgs/_lowlevel.c:6899:53: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__LineSearchAlgo(LBFGS_LINESEARCH_MORETHUENT
^
lbfgs/_lowlevel.c:6911:53: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__LineSearchAlgo(LBFGS_LINESEARCH_BACKTRACKI
^
lbfgs/_lowlevel.c:6923:53: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__LineSearchAlgo(LBFGS_LINESEARCH_BACKTRACKI
^
lbfgs/_lowlevel.c:6935:53: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__LineSearchAlgo(LBFGS_LINESEARCH_BACKTRACKI
^
lbfgs/_lowlevel.c:6951:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_UNKNOWNERROR); if (unl
^
lbfgs/_lowlevel.c:6963:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_LOGICERROR); if (unlik
^
lbfgs/_lowlevel.c:6975:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_OUTOFMEMORY); if (unli
^
lbfgs/_lowlevel.c:6987:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_CANCELED); if (unlikel
^
lbfgs/_lowlevel.c:6999:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_N); if (unlike
^
lbfgs/_lowlevel.c:7011:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_N_SSE); if (un
^
lbfgs/_lowlevel.c:7023:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_X_SSE); if (un
^
lbfgs/_lowlevel.c:7035:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_EPSILON); if (
^
lbfgs/_lowlevel.c:7047:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_TESTPERIOD); i
^
lbfgs/_lowlevel.c:7059:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_DELTA); if (un
^
lbfgs/_lowlevel.c:7071:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_LINESEARCH); i
^
lbfgs/_lowlevel.c:7083:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_MINSTEP); if (
^
lbfgs/_lowlevel.c:7095:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_MAXSTEP); if (
^
lbfgs/_lowlevel.c:7107:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_FTOL); if (unl
^
lbfgs/_lowlevel.c:7119:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_WOLFE); if (un
^
lbfgs/_lowlevel.c:7131:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_GTOL); if (unl
^
lbfgs/_lowlevel.c:7143:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_XTOL); if (unl
^
lbfgs/_lowlevel.c:7155:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_MAXLINESEARCH)
^
lbfgs/_lowlevel.c:7167:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_ORTHANTWISE);
^
lbfgs/_lowlevel.c:7179:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_ORTHANTWISE_ST
^
lbfgs/_lowlevel.c:7191:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALID_ORTHANTWISE_EN
^
lbfgs/_lowlevel.c:7203:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_OUTOFINTERVAL); if (un
^
lbfgs/_lowlevel.c:7215:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INCORRECT_TMINMAX); if
^
lbfgs/_lowlevel.c:7227:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_ROUNDING_ERROR); if (u
^
lbfgs/_lowlevel.c:7239:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_MINIMUMSTEP); if (unli
^
lbfgs/_lowlevel.c:7251:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_MAXIMUMSTEP); if (unli
^
lbfgs/_lowlevel.c:7263:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_MAXIMUMLINESEARCH); if
^
lbfgs/_lowlevel.c:7275:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_MAXIMUMITERATION); if
^
lbfgs/_lowlevel.c:7287:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_WIDTHTOOSMALL); if (un
^
lbfgs/_lowlevel.c:7299:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INVALIDPARAMETERS); if
^
lbfgs/_lowlevel.c:7311:49: error: type of formal parameter 1 is incomplete
__pyx_t_2 = __Pyx_PyInt_From_enum__ReturnCode(LBFGSERR_INCREASEGRADIENT); if
^
lbfgs/_lowlevel.c: At top level:
lbfgs/_lowlevel.c:8582:85: warning: ‘enum LineSearchAlgo’ declared inside parameter list
CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__LineSearchAlgo(enum LineSearchA
^
lbfgs/_lowlevel.c:8582:100: error: parameter 1 (‘value’) has incomplete type
NE PyObject* __Pyx_PyInt_From_enum__LineSearchAlgo(enum LineSearchAlgo value) {
^
lbfgs/_lowlevel.c: In function ‘__Pyx_PyInt_From_enum__LineSearchAlgo’:
lbfgs/_lowlevel.c:8583:16: error: variable ‘neg_one’ has initializer but incomplete type
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8583:47: error: conversion to incomplete type
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8583:31: error: storage size of ‘neg_one’ isn’t known
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8583:47: error: variable ‘const_zero’ has initializer but incomplete type
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8583:86: error: conversion to incomplete type
neSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero = (enum LineSearchA
^
lbfgs/_lowlevel.c:8583:67: error: storage size of ‘const_zero’ isn’t known
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8586:20: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
if (sizeof(enum LineSearchAlgo) < sizeof(long)) {
^
lbfgs/_lowlevel.c:8588:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
} else if (sizeof(enum LineSearchAlgo) <= sizeof(unsigned long)) {
^
lbfgs/_lowlevel.c:8590:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
} else if (sizeof(enum LineSearchAlgo) <= sizeof(unsigned PY_LONG_LONG)
^
lbfgs/_lowlevel.c:8594:20: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
if (sizeof(enum LineSearchAlgo) <= sizeof(long)) {
^
lbfgs/_lowlevel.c:8596:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
} else if (sizeof(enum LineSearchAlgo) <= sizeof(PY_LONG_LONG)) {
^
lbfgs/_lowlevel.c:8603:52: error: invalid application of ‘sizeof’ to incomplete type ‘enum LineSearchAlgo’
return _PyLong_FromByteArray(bytes, sizeof(enum LineSearchAlgo),
^
lbfgs/_lowlevel.c:8583:67: warning: unused variable ‘const_zero’ [-Wunused-variable]
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c:8583:31: warning: unused variable ‘neg_one’ [-Wunused-variable]
const enum LineSearchAlgo neg_one = (enum LineSearchAlgo) -1, const_zero =
^
lbfgs/_lowlevel.c: At top level:
lbfgs/_lowlevel.c:8609:81: warning: ‘enum ReturnCode’ declared inside parameter list
atic CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ReturnCode(enum ReturnCode
^
lbfgs/_lowlevel.c:8609:92: error: parameter 1 (‘value’) has incomplete type
HON_INLINE PyObject* __Pyx_PyInt_From_enum__ReturnCode(enum ReturnCode value) {
^
lbfgs/_lowlevel.c: In function ‘__Pyx_PyInt_From_enum__ReturnCode’:
lbfgs/_lowlevel.c:8610:16: error: variable ‘neg_one’ has initializer but incomplete type
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8610:43: error: conversion to incomplete type
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8610:27: error: storage size of ‘neg_one’ isn’t known
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8610:43: error: variable ‘const_zero’ has initializer but incomplete type
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8610:78: error: conversion to incomplete type
enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum ReturnCode)
^
lbfgs/_lowlevel.c:8610:59: error: storage size of ‘const_zero’ isn’t known
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8613:20: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
if (sizeof(enum ReturnCode) < sizeof(long)) {
^
lbfgs/_lowlevel.c:8615:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
} else if (sizeof(enum ReturnCode) <= sizeof(unsigned long)) {
^
lbfgs/_lowlevel.c:8617:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
} else if (sizeof(enum ReturnCode) <= sizeof(unsigned PY_LONG_LONG)) {
^
lbfgs/_lowlevel.c:8621:20: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
if (sizeof(enum ReturnCode) <= sizeof(long)) {
^
lbfgs/_lowlevel.c:8623:27: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
} else if (sizeof(enum ReturnCode) <= sizeof(PY_LONG_LONG)) {
^
lbfgs/_lowlevel.c:8630:52: error: invalid application of ‘sizeof’ to incomplete type ‘enum ReturnCode’
return _PyLong_FromByteArray(bytes, sizeof(enum ReturnCode),
^
lbfgs/_lowlevel.c:8610:59: warning: unused variable ‘const_zero’ [-Wunused-variable]
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c:8610:27: warning: unused variable ‘neg_one’ [-Wunused-variable]
const enum ReturnCode neg_one = (enum ReturnCode) -1, const_zero = (enum Re
^
lbfgs/_lowlevel.c: In function ‘__Pyx_PyInt_From_enum__LineSearchAlgo’:
lbfgs/_lowlevel.c:8606:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
lbfgs/_lowlevel.c: In function ‘__Pyx_PyInt_From_enum__ReturnCode’:
lbfgs/_lowlevel.c:8633:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Push to pypi

Would you mind pushing this to pypi? Would like to use this for a couple of projects.

pip installation problem

Opening a completely fresh directory and trying to install pylbfgs fails.

$ python3 -m venv env --prompt proj@testing
$ source env/bin/activate
(proj@testing) $ python --version
Python 3.11.3
(proj@testing) $ pip install --upgrade pip
Requirement already satisfied: pip in ./env/lib/python3.11/site-packages (23.0.1)
Collecting pip
  Using cached pip-23.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-23.2
(proj@testing) $ pip install pylbfgs
Collecting pylbfgs
  Using cached PyLBFGS-0.2.0.14.tar.gz (98 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
 
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [57 lines of output]
      /private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-install-9efii02m/pylbfgs_642bfcdecb0e483c9161a5cf7c9875f6/lbfgs/_lowlevel.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
 
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
 
              x_a = aligned_copy(x0.ravel())
 
              try:
                  callback_data = (f, progress, x0.shape, args)
                  r = lbfgs(n, x_a, fx_final, call_eval,
                                              ^
      ------------------------------------------------------------
 
      lbfgs/_lowlevel.pyx:395:40: Cannot assign type 'lbfgsfloatval_t (void *, lbfgsconst_p, lbfgsfloatval_t *, int, lbfgsfloatval_t) except? -1' to 'lbfgs_evaluate_t'
 
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              x_a = aligned_copy(x0.ravel())
 
              try:
                  callback_data = (f, progress, x0.shape, args)
                  r = lbfgs(n, x_a, fx_final, call_eval,
                            call_progress, <void *>callback_data, &self.params)
                            ^
      ------------------------------------------------------------
 
      lbfgs/_lowlevel.pyx:396:22: Cannot assign type 'int (void *, lbfgsconst_p, lbfgsconst_p, lbfgsfloatval_t, lbfgsfloatval_t, lbfgsfloatval_t, lbfgsfloatval_t, int, int, int) except? -1' to 'lbfgs_progress_t'
      Compiling lbfgs/_lowlevel.pyx because it changed.
      [1/1] Cythonizing lbfgs/_lowlevel.pyx
      Traceback (most recent call last):
        File "/Users/bufas/dev/proj/testing/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/bufas/dev/proj/testing/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/bufas/dev/proj/testing/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 27, in <module>
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/jg/pb4kddl17kzf4njent3ht8rh0000gn/T/pip-build-env-bemxqhla/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: lbfgs/_lowlevel.pyx
      [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
 
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
 
note: This error originates from a subprocess, and is likely not a problem with pip.
(proj@testing) $

Using OWL-QN correctly

I'm trying to minimize the L1 norm of x for the system Ax==b using the OWL-QN algorithm. However, it's not clear to me from the documentations of libLBFGS and pyLBFGS how to do this. I'm assuming that we should use the fmin_lbfgs(...) method, but how to define the callable f and its gradient vector g? Any quick suggestions?

How to use OWL-QN

Hello,

I am able to run the LBFGS though I would like to know how to run the OWL-QN.
Can't seem to understand how.

Thanks in advance!

Installation problem

Hello
I am using windows 8 with anaconda python. I am unable to install pylbfgs module, when i used this conda install -c fgregg pylbfgs gives the following error
pylbfgs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.