Skip to content

Commit 09cace9

Browse files
Merge pull request #32 from numericalalgorithmsgroup/convex_constraints
Convex constraints
2 parents 3a3bd50 + 88c5a80 commit 09cace9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2574
-1213
lines changed

README.rst

+13-32
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ More details about Py-BOBYQA and its enhancements over BOBYQA can be found in ou
2828

2929
1. Coralia Cartis, Jan Fiala, Benjamin Marteau and Lindon Roberts, `Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers <https://doi.org/10.1145/3338517>`_, *ACM Transactions on Mathematical Software*, 45:3 (2019), pp. 32:1-32:41 [`arXiv preprint: 1804.00154 <https://arxiv.org/abs/1804.00154>`_]
3030
2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, `Escaping local minima with derivative-free methods: a numerical investigation <https://doi.org/10.1080/02331934.2021.1883015>`_, *Optimization*, 71:8 (2022), pp. 2343-2373. [`arXiv preprint: 1812.11343 <https://arxiv.org/abs/1812.11343>`_]
31+
3. Lindon Roberts, `Model Construction for Convex-Constrained Derivative-Free Optimization <https://arxiv.org/abs/2403.14960>`_, *arXiv preprint arXiv:2403.14960* (2024).
3132

32-
Please cite [1] when using Py-BOBYQA for local optimization, and [1,2] when using Py-BOBYQA's global optimization heuristic functionality. For reproducibility of all figures, please feel free to contact the authors.
33+
Please cite [1] when using Py-BOBYQA for local optimization, [1,2] when using Py-BOBYQA's global optimization heuristic functionality, and [1,3] if using the general convex constraints functionality.
3334

3435
The original paper by Powell is: M. J. D. Powell, The BOBYQA algorithm for bound constrained optimization without derivatives, technical report DAMTP 2009/NA06, University of Cambridge (2009), and the original Fortran implementation is available `here <http://mat.uc.pt/~zhang/software.html>`_.
3536

@@ -41,13 +42,13 @@ See manual.pdf or the `online manual <https://numericalalgorithmsgroup.github.io
4142

4243
Citation
4344
--------
44-
If you use Py-BOBYQA in a paper, please cite:
45+
Full details of the Py-BOBYQA algorithm are given in our papers:
4546

46-
Cartis, C., Fiala, J., Marteau, B. and Roberts, L., Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers, *ACM Transactions on Mathematical Software*, 45:3 (2019), pp. 32:1-32:41.
47+
1. Coralia Cartis, Jan Fiala, Benjamin Marteau and Lindon Roberts, `Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers <https://doi.org/10.1145/3338517>`_, *ACM Transactions on Mathematical Software*, 45:3 (2019), pp. 32:1-32:41 [`preprint <https://arxiv.org/abs/1804.00154>`_]
48+
2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, `Escaping local minima with derivative-free methods: a numerical investigation <https://doi.org/10.1080/02331934.2021.1883015>`_, *Optimization*, 71:8 (2022), pp. 2343-2373. [`arXiv preprint: 1812.11343 <https://arxiv.org/abs/1812.11343>`_]
49+
3. Lindon Roberts, `Model Construction for Convex-Constrained Derivative-Free Optimization <https://arxiv.org/abs/2403.14960>`_, *arXiv preprint arXiv:2403.14960* (2024).
4750

48-
If you use Py-BOBYQA's global optimization heuristic, please cite the above and also
49-
50-
Cartis, C., Roberts, L. and Sheridan-Methven, O., Escaping local minima with derivative-free methods: a numerical investigation, Optimization, 71:8 (2022), pp. 2343-2373.
51+
Please cite [1] when using Py-BOBYQA for local optimization, [1,2] when using Py-BOBYQA's global optimization heuristic functionality, and [1,3] if using the general convex constraints functionality.
5152

5253
Requirements
5354
------------
@@ -65,31 +66,17 @@ Additionally, the following python packages should be installed (these will be i
6566

6667
Installation using pip
6768
----------------------
68-
For easy installation, use `pip <http://www.pip-installer.org/>`_ as root:
69-
70-
.. code-block:: bash
71-
72-
$ [sudo] pip install Py-BOBYQA
73-
74-
or alternatively *easy_install*:
75-
76-
.. code-block:: bash
77-
78-
$ [sudo] easy_install Py-BOBYQA
79-
80-
If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:
69+
For easy installation, use `pip <http://www.pip-installer.org/>`_:
8170

8271
.. code-block:: bash
8372
84-
$ pip install --user Py-BOBYQA
85-
86-
which will install Py-BOBYQA in your home directory.
73+
$ pip install Py-BOBYQA
8774
8875
Note that if an older install of Py-BOBYQA is present on your system you can use:
8976

9077
.. code-block:: bash
9178
92-
$ [sudo] pip install --upgrade Py-BOBYQA
79+
$ pip install --upgrade Py-BOBYQA
9380
9481
to upgrade Py-BOBYQA to the latest version.
9582

@@ -106,13 +93,7 @@ Py-BOBYQA is written in pure Python and requires no compilation. It can be insta
10693

10794
.. code-block:: bash
10895
109-
$ [sudo] pip install .
110-
111-
If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:
112-
113-
.. code-block:: bash
114-
115-
$ pip install --user .
96+
$ pip install .
11697
11798
instead.
11899

@@ -121,7 +102,7 @@ To upgrade Py-BOBYQA to the latest version, navigate to the top-level directory
121102
.. code-block:: bash
122103
123104
$ git pull
124-
$ [sudo] pip install . # with admin privileges
105+
$ pip install .
125106
126107
Testing
127108
-------
@@ -144,7 +125,7 @@ If Py-BOBYQA was installed using *pip* you can uninstall as follows:
144125

145126
.. code-block:: bash
146127
147-
$ [sudo] pip uninstall Py-BOBYQA
128+
$ pip uninstall Py-BOBYQA
148129
149130
If Py-BOBYQA was installed manually you have to remove the installed files by hand (located in your python site-packages directory).
150131

docs/advanced.rst

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Logging and Output
2121

2222
Initialization of Points
2323
------------------------
24-
* :code:`init.random_initial_directions` - Build the initial interpolation set using random directions (as opposed to coordinate directions). Default is :code:`True`.
25-
* :code:`init.random_directions_make_orthogonal` - If building initial interpolation set with random directions, whether or not these should be orthogonalized. Default is :code:`True`.
26-
* :code:`init.run_in_parallel` - If using random directions, whether or not to ask for all :code:`objfun` to be evaluated at all points without any intermediate processing. Default is :code:`False`.
24+
* :code:`init.random_initial_directions` - Build the initial interpolation set using random directions (as opposed to coordinate directions). Default is :code:`True`. Not used if general convex constraints provided.
25+
* :code:`init.random_directions_make_orthogonal` - If building initial interpolation set with random directions, whether or not these should be orthogonalized. Default is :code:`True`. Not used if general convex constraints provided.
26+
* :code:`init.run_in_parallel` - If using random directions, whether or not to ask for all :code:`objfun` to be evaluated at all points without any intermediate processing. Default is :code:`False`. Not used if general convex constraints provided.
2727

2828
Trust Region Management
2929
-----------------------
@@ -74,6 +74,12 @@ Multiple Restarts
7474
* :code:`restarts.auto_detect.min_chg_model_slope` - Minimum rate of increase of :math:`\log(\|g_k-g_{k-1}\|)` and :math:`\log(\|H_k-H_{k-1}\|_F)` over the past iterations to cause a restart. Default is 0.015.
7575
* :code:`restarts.auto_detect.min_correl` - Minimum correlation of the data sets :math:`(k, \log(\|g_k-g_{k-1}\|))` and :math:`(k, \log(\|H_k-H_{k-1}\|_F))` required to cause a restart. Default is 0.1.
7676

77+
General Convex Constraints
78+
--------------------------
79+
* :code:`projections.dykstra.d_tol` - termination tolerance for Dykstra's algorithm for computing the projection onto the intersection of all convex constraints. Default is :math:`10^{-10}`.
80+
* :code:`projections.dykstra.max_iters` - maximum iterations of Dykstra's algorithm for computing the projection onto the intersection of all convex constraints. Default is 100.
81+
* :code:`projections.feasible_tol` - tolerance for checking feasibility of initial points with respect to general convex constraints. Default is :math:`10^{-10}`.
82+
* :code:`projections.pgd_tol` - termination tolerance for trust-region and geometry-improving subproblems. Default is :math:`10^{-8}`.
7783

7884
References
7985
----------

docs/build/doctrees/advanced.doctree

3.7 KB
Binary file not shown.
12 Bytes
Binary file not shown.
-275 KB
Binary file not shown.

docs/build/doctrees/history.doctree

-205 Bytes
Binary file not shown.

docs/build/doctrees/index.doctree

2.1 KB
Binary file not shown.

docs/build/doctrees/info.doctree

202 Bytes
Binary file not shown.

docs/build/doctrees/install.doctree

-1.68 KB
Binary file not shown.

docs/build/doctrees/userguide.doctree

18.2 KB
Binary file not shown.

docs/build/html/.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 71b7b5e9dd47a27f370b73edfaf0d9fa
3+
config: 23c30e3852e30f05e3745555cbeb2562
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/build/html/_sources/advanced.rst.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Logging and Output
2121

2222
Initialization of Points
2323
------------------------
24-
* :code:`init.random_initial_directions` - Build the initial interpolation set using random directions (as opposed to coordinate directions). Default is :code:`True`.
25-
* :code:`init.random_directions_make_orthogonal` - If building initial interpolation set with random directions, whether or not these should be orthogonalized. Default is :code:`True`.
26-
* :code:`init.run_in_parallel` - If using random directions, whether or not to ask for all :code:`objfun` to be evaluated at all points without any intermediate processing. Default is :code:`False`.
24+
* :code:`init.random_initial_directions` - Build the initial interpolation set using random directions (as opposed to coordinate directions). Default is :code:`True`. Not used if general convex constraints provided.
25+
* :code:`init.random_directions_make_orthogonal` - If building initial interpolation set with random directions, whether or not these should be orthogonalized. Default is :code:`True`. Not used if general convex constraints provided.
26+
* :code:`init.run_in_parallel` - If using random directions, whether or not to ask for all :code:`objfun` to be evaluated at all points without any intermediate processing. Default is :code:`False`. Not used if general convex constraints provided.
2727

2828
Trust Region Management
2929
-----------------------
@@ -74,6 +74,12 @@ Multiple Restarts
7474
* :code:`restarts.auto_detect.min_chg_model_slope` - Minimum rate of increase of :math:`\log(\|g_k-g_{k-1}\|)` and :math:`\log(\|H_k-H_{k-1}\|_F)` over the past iterations to cause a restart. Default is 0.015.
7575
* :code:`restarts.auto_detect.min_correl` - Minimum correlation of the data sets :math:`(k, \log(\|g_k-g_{k-1}\|))` and :math:`(k, \log(\|H_k-H_{k-1}\|_F))` required to cause a restart. Default is 0.1.
7676

77+
General Convex Constraints
78+
--------------------------
79+
* :code:`projections.dykstra.d_tol` - termination tolerance for Dykstra's algorithm for computing the projection onto the intersection of all convex constraints. Default is :math:`10^{-10}`.
80+
* :code:`projections.dykstra.max_iters` - maximum iterations of Dykstra's algorithm for computing the projection onto the intersection of all convex constraints. Default is 100.
81+
* :code:`projections.feasible_tol` - tolerance for checking feasibility of initial points with respect to general convex constraints. Default is :math:`10^{-10}`.
82+
* :code:`projections.pgd_tol` - termination tolerance for trust-region and geometry-improving subproblems. Default is :math:`10^{-8}`.
7783

7884
References
7985
----------

docs/build/html/_sources/history.rst.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Version 1.4 (16 May 2023)
4848
* Bugfix: reset slow iteration counter when doing soft restarts
4949

5050
Version 1.4.1 (11 Apr 2024)
51-
-------------------------
51+
---------------------------
5252
* Migrate package setup to pyproject.toml (required for Python version 3.12)
5353
* Drop support for Python 2.7 and <=3.7 due to new setup process
54+
55+
Version 1.5.0 (16 Sep 2024)
56+
---------------------------
57+
* Added support for general convex constraints

docs/build/html/_sources/index.rst.txt

+10-6
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@ Py-BOBYQA: Derivative-Free Optimizer for Bound-Constrained Minimization
1212

1313
**Author:** `Lindon Roberts <lindon.roberts@sydney.edu.au>`_
1414

15-
Py-BOBYQA is a flexible package for finding local solutions to nonlinear, nonconvex minimization problems (with optional bound constraints), without requiring any derivatives of the objective. Py-BOBYQA is a Python implementation of the `BOBYQA <http://mat.uc.pt/~zhang/software.html#powell_software>`_ solver by Powell (documentation `here <http://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf>`_). It is particularly useful when evaluations of the objective function are expensive and/or noisy.
15+
Py-BOBYQA is a flexible package for finding local solutions to nonlinear, nonconvex minimization problems (with optional bound and other convex constraints), without requiring any derivatives of the objective. Py-BOBYQA is a Python implementation of the `BOBYQA <http://mat.uc.pt/~zhang/software.html#powell_software>`_ solver by Powell (documentation `here <http://www.damtp.cam.ac.uk/user/na/NA_papers/NA2009_06.pdf>`_). It is particularly useful when evaluations of the objective function are expensive and/or noisy.
1616

1717
That is, Py-BOBYQA solves
1818

1919
.. math::
2020
2121
\min_{x\in\mathbb{R}^n} &\quad f(x)\\
22-
\text{s.t.} &\quad a \leq x \leq b
22+
\text{s.t.} &\quad a \leq x \leq b \\
23+
&\quad x \in C := C_1 \cap \cdots \cap C_n, \quad \text{all $C_i$ convex}
2324
24-
The upper and lower bounds on the variables are non-relaxable (i.e. Py-BOBYQA will never ask to evaluate a point outside the bounds).
25+
If provided, the constraints the variables are non-relaxable (i.e. Py-BOBYQA will never ask to evaluate a point outside the bounds),
26+
although the general :math:`x \in C` constraint may be slightly violated from rounding errors.
2527

2628
Full details of the Py-BOBYQA algorithm are given in our papers:
2729

2830
1. Coralia Cartis, Jan Fiala, Benjamin Marteau and Lindon Roberts, `Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers <https://doi.org/10.1145/3338517>`_, *ACM Transactions on Mathematical Software*, 45:3 (2019), pp. 32:1-32:41 [`preprint <https://arxiv.org/abs/1804.00154>`_]
29-
2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, `Escaping local minima with derivative-free methods: a numerical investigation <https://doi.org/10.1080/02331934.2021.1883015>`_, *Optimization*, 71:8 (2022), pp. 2343-2373. [`arXiv preprint: 1812.11343 <https://arxiv.org/abs/1812.11343>`_]
31+
2. Coralia Cartis, Lindon Roberts and Oliver Sheridan-Methven, `Escaping local minima with derivative-free methods: a numerical investigation <https://doi.org/10.1080/02331934.2021.1883015>`_, *Optimization*, 71:8 (2022), pp. 2343-2373. [`arXiv preprint: 1812.11343 <https://arxiv.org/abs/1812.11343>`_]
32+
3. Lindon Roberts, `Model Construction for Convex-Constrained Derivative-Free Optimization <https://arxiv.org/abs/2403.14960>`_, *arXiv preprint arXiv:2403.14960* (2024).
3033

31-
Please cite [1] when using Py-BOBYQA for local optimization, and [1,2] when using Py-BOBYQA's global optimization heuristic functionality.
34+
Please cite [1] when using Py-BOBYQA for local optimization, [1,2] when using Py-BOBYQA's global optimization heuristic functionality, and [1,3] if using the general convex constraints :math:`x \in C` functionality.
3235

3336
If you are interested in solving least-squares minimization problems, you may wish to try `DFO-LS <https://github.com/numericalalgorithmsgroup/dfols>`_, which has the same features as Py-BOBYQA (plus some more), and exploits the least-squares problem structure, so performs better on such problems.
3437

@@ -49,5 +52,6 @@ Py-BOBYQA is released under the GNU General Public License. Please `contact NAG
4952

5053
Acknowledgements
5154
----------------
52-
This software was developed under the supervision of `Coralia Cartis <https://www.maths.ox.ac.uk/people/coralia.cartis>`_, and was supported by the EPSRC Centre For Doctoral Training in `Industrially Focused Mathematical Modelling <https://www.maths.ox.ac.uk/study-here/postgraduate-study/industrially-focused-mathematical-modelling-epsrc-cdt>`_ (EP/L015803/1) in collaboration with the `Numerical Algorithms Group <http://www.nag.com/>`_.
55+
This software was initially developed under the supervision of `Coralia Cartis <https://www.maths.ox.ac.uk/people/coralia.cartis>`_, and was supported by the EPSRC Centre For Doctoral Training in `Industrially Focused Mathematical Modelling <https://www.maths.ox.ac.uk/study-here/postgraduate-study/industrially-focused-mathematical-modelling-epsrc-cdt>`_ (EP/L015803/1) in collaboration with the `Numerical Algorithms Group <http://www.nag.com/>`_.
56+
Development of Py-BOBYQA has also been supported by the Australian Research Council (DE240100006).
5357

docs/build/html/_sources/info.rst.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ Overview
33

44
When to use Py-BOBYQA
55
---------------------
6-
Py-BOBYQA is designed to solve the nonlinear least-squares minimization problem (with optional bound constraints)
6+
Py-BOBYQA is designed to solve the nonlinear least-squares minimization problem (with optional bound and general convex constraints)
77

88
.. math::
99
1010
\min_{x\in\mathbb{R}^n} &\quad f(x)\\
11-
\text{s.t.} &\quad a \leq x \leq b
11+
\text{s.t.} &\quad a \leq x \leq b\\
12+
&\quad x \in C := C_1 \cap \cdots \cap C_n, \quad \text{all $C_i$ convex}
1213
1314
We call :math:`f(x)` the objective function.
1415

docs/build/html/_sources/install.rst.txt

+6-22
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,17 @@ Additionally, the following python packages should be installed (these will be i
1717

1818
Installation using pip
1919
----------------------
20-
For easy installation, use `pip <http://www.pip-installer.org/>`_ as root:
20+
For easy installation, use `pip <http://www.pip-installer.org/>`_:
2121

2222
.. code-block:: bash
2323
24-
$ [sudo] pip install Py-BOBYQA
25-
26-
If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:
27-
28-
.. code-block:: bash
29-
30-
$ pip install --user Py-BOBYQA
31-
32-
which will install Py-BOBYQA in your home directory.
24+
$ pip install Py-BOBYQA
3325
3426
Note that if an older install of Py-BOBYQA is present on your system you can use:
3527

3628
.. code-block:: bash
3729
38-
$ [sudo] pip install --upgrade Py-BOBYQA
30+
$ pip install --upgrade Py-BOBYQA
3931
4032
to upgrade Py-BOBYQA to the latest version.
4133

@@ -52,22 +44,14 @@ Py-BOBYQA is written in pure Python and requires no compilation. It can be insta
5244

5345
.. code-block:: bash
5446
55-
$ [sudo] pip install .
56-
57-
If you do not have root privileges or you want to install Py-BOBYQA for your private use, you can use:
58-
59-
.. code-block:: bash
60-
61-
$ pip install --user .
62-
63-
instead.
47+
$ pip install .
6448
6549
To upgrade Py-BOBYQA to the latest version, navigate to the top-level directory (i.e. the one containing :code:`setup.py`) and rerun the installation using :code:`pip`, as above:
6650

6751
.. code-block:: bash
6852
6953
$ git pull
70-
$ [sudo] pip install . # with admin privileges
54+
$ pip install .
7155
7256
Testing
7357
-------
@@ -84,7 +68,7 @@ If Py-BOBYQA was installed using `pip <http://www.pip-installer.org/>`_ you can
8468

8569
.. code-block:: bash
8670
87-
$ [sudo] pip uninstall Py-BOBYQA
71+
$ pip uninstall Py-BOBYQA
8872
8973
If Py-BOBYQA was installed manually you have to remove the installed files by hand (located in your python site-packages directory).
9074

0 commit comments

Comments
 (0)