Skip to content

Commit 7eb2371

Browse files
committed
Explain bounds are non-relaxable in documentation, don't change x0 if feasible (but close to bounds), add gfortran dependency to documentation, update examples to remove random seed requirement. This closes #6 and closes #8.
1 parent 0b758fe commit 7eb2371

File tree

11 files changed

+14
-24
lines changed

11 files changed

+14
-24
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Requirements
3939
DFO-LS requires the following software to be installed:
4040

4141
* Python 2.7 or Python 3 (http://www.python.org/)
42+
* Fortran compiler (e.g. gfortran)
4243

4344
Additionally, the following python packages should be installed (these will be installed automatically if using *pip*, see `Installation using pip`_):
4445

dfols/solver.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -941,21 +941,11 @@ def solve(objfun, x0, args=(), bounds=None, npt=None, rhobeg=None, rhoend=1e-8,
941941
return results
942942

943943
# Enforce lower & upper bounds on x0
944-
idx = (xl < x0) & (x0 <= xl + rhobeg)
945-
if np.any(idx):
946-
warnings.warn("x0 too close to lower bound, adjusting", RuntimeWarning)
947-
x0[idx] = xl[idx] + rhobeg
948-
949944
idx = (x0 <= xl)
950945
if np.any(idx):
951946
warnings.warn("x0 below lower bound, adjusting", RuntimeWarning)
952947
x0[idx] = xl[idx]
953948

954-
idx = (xu - rhobeg <= x0) & (x0 < xu)
955-
if np.any(idx):
956-
warnings.warn("x0 too close to upper bound, adjusting", RuntimeWarning)
957-
x0[idx] = xu[idx] - rhobeg
958-
959949
idx = (x0 >= xu)
960950
if np.any(idx):
961951
warnings.warn("x0 above upper bound, adjusting", RuntimeWarning)

dfols/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
2323
"""
2424

25-
__version__ = '1.1.1'
25+
__version__ = '1.2'

docs/history.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,11 @@ Version 1.1.1 (5 Apr 2019)
2424
--------------------------
2525
* Link code to Zenodo, to create DOI - no changes to the DFO-LS algorithm.
2626

27+
Version 1.2
28+
-----------
29+
* Use deterministic initialisation by default (so it is no longer necessary to set a random seed for reproducibility of DFO-LS results).
30+
* Full model Hessian stored rather than just upper triangular part - this improves the runtime of Hessian-based operations.
31+
* Faster trust-region and geometry subproblem solutions in Fortran using the `trustregion <https://github.com/lindonroberts/trust-region>`_ package.
32+
* Faster interpolation solution for multiple right-hand sides.
33+
* Don't adjust starting point if it is close to the bounds (as long as it is feasible).
34+
* Bugfix: correctly handle 1-sided bounds as inputs.

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ That is, DFO-LS solves
2020
\min_{x\in\mathbb{R}^n} &\quad f(x) := \sum_{i=1}^{m}r_{i}(x)^2 \\
2121
\text{s.t.} &\quad a \leq x \leq b
2222
23+
The upper and lower bounds on the variables are non-relaxable (i.e. DFO-LS will never ask to evaluate a point outside the bounds).
24+
2325
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://arxiv.org/abs/1804.00154>`_, technical report, University of Oxford, (2018). DFO-LS is a more flexible version of `DFO-GN <https://github.com/numericalalgorithmsgroup/dfogn>`_.
2426

2527
If you are interested in solving general optimization problems (without a least-squares structure), you may wish to try `Py-BOBYQA <https://github.com/numericalalgorithmsgroup/pybobyqa>`_, which has many of the same features as DFO-LS.

docs/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Requirements
66
DFO-LS requires the following software to be installed:
77

88
* Python 2.7 or Python 3 (http://www.python.org/)
9+
* Fortran compiler (e.g. gfortran)
910

1011
Additionally, the following python packages should be installed (these will be installed automatically if using *pip*, see `Installation using pip`_):
1112

docs/userguide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DFO-LS is designed to solve the local optimization problem
1111
\min_{x\in\mathbb{R}^n} &\quad f(x) := \sum_{i=1}^{m}r_{i}(x)^2 \\
1212
\text{s.t.} &\quad a \leq x \leq b
1313
14-
where the bound constraints :math:`a \leq x \leq b` are optional.
14+
where the bound constraints :math:`a \leq x \leq b` are optional. The upper and lower bounds on the variables are non-relaxable (i.e. DFO-LS will never ask to evaluate a point outside the bounds).
1515

1616
DFO-LS iteratively constructs an interpolation-based model for the objective, and determines a step using a trust-region framework.
1717
For an in-depth technical description of the algorithm see the paper [CFMR2018]_.

examples/data_fitting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ def prediction_error(x):
1818
# Define the starting point
1919
x0 = np.array([100.0, -1.0])
2020

21-
# Set random seed (for reproducibility)
22-
np.random.seed(0)
23-
2421
# We expect exponential decay: set upper bound x[1] <= 0
2522
upper = np.array([1e20, 0.0])
2623

examples/nonlinear_system.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ def nonlinear_system(x):
1818
# DFO-LS returns will likely depend on x0!
1919
x0 = np.array([0.1, -2.0])
2020

21-
# Set random seed (for reproducibility)
22-
np.random.seed(0)
23-
2421
# Call DFO-LS
2522
soln = dfols.solve(nonlinear_system, x0)
2623

examples/rosenbrock_basic.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ def rosenbrock(x):
1010
# Define the starting point
1111
x0 = np.array([-1.2, 1.0])
1212

13-
# Set random seed (for reproducibility)
14-
np.random.seed(0)
15-
1613
# For optional extra output details
1714
# import logging
1815
# logging.basicConfig(level=logging.INFO, format='%(message)s')

0 commit comments

Comments
 (0)