Skip to content

Commit b12275c

Browse files
committed
Added convex constraint examples and documentation, removed 'sudo pip' from installation info, added ARC funding ackowledgement
1 parent 7173cab commit b12275c

Some content is hidden

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

60 files changed

+1984
-1156
lines changed

README.rst

+6-26
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,17 @@ Additionally, the following python packages should be installed (these will be i
6565

6666
Installation using pip
6767
----------------------
68-
For easy installation, use `pip <http://www.pip-installer.org/>`_ as root:
68+
For easy installation, use `pip <http://www.pip-installer.org/>`_:
6969

7070
.. code-block:: bash
7171
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:
81-
82-
.. code-block:: bash
83-
84-
$ pip install --user Py-BOBYQA
85-
86-
which will install Py-BOBYQA in your home directory.
72+
$ pip install Py-BOBYQA
8773
8874
Note that if an older install of Py-BOBYQA is present on your system you can use:
8975

9076
.. code-block:: bash
9177
92-
$ [sudo] pip install --upgrade Py-BOBYQA
78+
$ pip install --upgrade Py-BOBYQA
9379
9480
to upgrade Py-BOBYQA to the latest version.
9581

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

10793
.. code-block:: bash
10894
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 .
95+
$ pip install .
11696
11797
instead.
11898

@@ -121,7 +101,7 @@ To upgrade Py-BOBYQA to the latest version, navigate to the top-level directory
121101
.. code-block:: bash
122102
123103
$ git pull
124-
$ [sudo] pip install . # with admin privileges
104+
$ pip install .
125105
126106
Testing
127107
-------
@@ -144,7 +124,7 @@ If Py-BOBYQA was installed using *pip* you can uninstall as follows:
144124

145125
.. code-block:: bash
146126
147-
$ [sudo] pip uninstall Py-BOBYQA
127+
$ pip uninstall Py-BOBYQA
148128
149129
If Py-BOBYQA was installed manually you have to remove the installed files by hand (located in your python site-packages directory).
150130

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

693 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: b4d3cbede435f0c6bf9260192e9bf9d7
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

+4
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ Version 1.4.1 (11 Apr 2024)
5151
-------------------------
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 (9 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 <[email protected]>`_
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)