You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DFO-LS is a flexible package for finding local solutions to nonlinear least-squares minimization problems (with optional convex constraints), without requiring any derivatives of the objective. DFO-LS stands for Derivative-Free Optimizer for Least-Squares.
14
+
DFO-LS is a flexible package for finding local solutions to nonlinear least-squares minimization problems (with optional constraints), without requiring any derivatives of the objective. DFO-LS stands for Derivative-Free Optimizer for Least-Squares.
The constraint set :math:`C` is assumed to be non-empty, closed and convex. Moreover, the constraints are non-relaxable (i.e. DFO-LS will never ask to evaluate a point that is not feasible).
24
+
The constraint set :math:`C` is the intersection of multiple convex sets provided as input by the user. All constraints are non-relaxable (i.e. DFO-LS will never ask to evaluate a point that is not feasible).
24
25
25
26
Full details of the DFO-LS algorithm are given in our paper: C. Cartis, J. Fiala, B. Marteau and L. 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>`_] . DFO-LS is a more flexible version of `DFO-GN <https://github.com/numericalalgorithmsgroup/dfogn>`_.
We call :math:`f(x)` the objective function and :math:`r_i(x)` the residual functions (or simply residuals).
14
-
Here :math:`C` is a non-empty and closed convex set.
15
+
:math:`C` is the intersection of multiple convex sets given as input by the user.
15
16
16
17
DFO-LS is a *derivative-free* optimization algorithm, which means it does not require the user to provide the derivatives of :math:`f(x)` or :math:`r_i(x)`, nor does it attempt to estimate them internally (by using finite differencing, for instance).
Copy file name to clipboardExpand all lines: docs/build/html/_sources/userguide.rst.txt
+90-36Lines changed: 90 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ Note that DFO-LS is a randomized algorithm: in its first phase, it builds an int
144
144
145
145
This and all following problems can be found in the `examples <https://github.com/numericalalgorithmsgroup/dfols/tree/master/examples>`_ directory on the DFO-LS Github page.
146
146
147
-
Adding Constraints and More Output
147
+
Adding Bounds and More Output
148
148
-----------------------------
149
149
We can extend the above script to add constraints. To add bound constraints alone, we can add the lines
150
150
@@ -181,41 +181,6 @@ However, we also get a warning that our starting point was outside of the bounds
181
181
182
182
DFO-LS automatically fixes this, and moves :math:`x_0` to a point within the bounds, in this case :math:`x_0=(-1.2,0.85)`.
183
183
184
-
If we want more complex constraints, we can instead write something like the following:
185
-
186
-
.. code-block:: python
187
-
188
-
# Define the projection functions
189
-
defpball(x):
190
-
c = np.array([0.7,1.5]) # ball centre
191
-
r =0.4# ball radius
192
-
return c + (r/np.max([np.linalg.norm(x-c),r]))*(x-c)
DFO-LS correctly finds the solution to this constrained problem too. Note that we get a warning because the step computed in the trust region subproblem
203
-
gave an increase in the model. This is common in the case where multiple constraints are active at the optimal point.
Warning (trust region increase): Either multiple constraints are active or trust region step gave model increase
216
-
****************************
217
-
218
-
219
184
We can also get DFO-LS to print out more detailed information about its progress using the `logging <https://docs.python.org/3/library/logging.html>`_ module. To do this, we need to add the following lines:
220
185
221
186
.. code-block:: python
@@ -259,6 +224,95 @@ An alternative option available is to get DFO-LS to print to terminal progress i
259
224
1 55 1.00e-02 2.00e-01 1.50e-08 1.00e-08 56
260
225
1 56 1.00e-02 2.00e-01 1.50e-08 1.00e-08 57
261
226
227
+
Handling Arbitrary Convex Constraints
228
+
-----------------------------
229
+
DFO-LS can also handle more general constraints where they can be written as the intersection of finitely many convex sets. For example, the below code
230
+
minimizes the Rosenbrock function subject to a constraint set given by the intersection of two convex sets. Note the intersection of the user-provided convex
231
+
sets must be non-empty.
232
+
233
+
.. code-block:: python
234
+
235
+
'''
236
+
DFO-LS example: minimize the Rosenbrock function with arbitrary convex constraints
237
+
238
+
This example defines two functions pball(x) and pbox(x) that project onto ball and
239
+
box constraint sets respectively. It then passes both these functions to the DFO-LS
240
+
solver so that it can find a constrained minimizer to the Rosenbrock function.
241
+
Such a minimizer must lie in the intersection of constraint sets corresponding to
242
+
projection functions pball(x) and pbox(x). The description of the problem is as follows:
Note that for bound constraints one can choose to either implement them by defining a projection function as above, or by passing the bounds as input like in the example from the section on adding bound constraints.
299
+
300
+
DFO-LS correctly finds the solution to this constrained problem too. Note that we get a warning because the step computed in the trust region subproblem
301
+
gave an increase in the model. This is common in the case where multiple constraints are active at the optimal point.
Warning (trust region increase): Either multiple constraints are active or trust region step gave model increase
314
+
****************************
315
+
262
316
Example: Noisy Objective Evaluation
263
317
-----------------------------------
264
318
As described in :doc:`info`, derivative-free algorithms such as DFO-LS are particularly useful when :code:`objfun` has noise. Let's modify the previous example to include random noise in our objective evaluation, and compare it to a derivative-based solver:
0 commit comments