Skip to content

Commit dfeb9a0

Browse files
committed
some cleanup, including replacing some single-quotes with double-quotes, removing some out-of-date commented-out code, fixing some links. adds 3 tentative categories on the Generator functions example page
1 parent bfe1a46 commit dfeb9a0

File tree

13 files changed

+75
-98
lines changed

13 files changed

+75
-98
lines changed

docs/examples/gen_funcs.rst

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,25 @@ Here we list many generator functions included with libEnsemble.
1010
See the API for generator functions :ref:`here<api_gen_f>`.
1111

1212
.. toctree::
13-
:maxdepth: 2
14-
:caption: Documented Example Generator Functions:
15-
16-
sampling
17-
aposmm
18-
uniform_or_localopt
19-
tasmanian
20-
fd_param_finder
21-
surmise
22-
ax_multitask
13+
:maxdepth: 2
14+
:caption: Sampling
15+
16+
sampling
17+
18+
.. toctree::
19+
:maxdepth: 2
20+
:caption: Optimization
21+
22+
aposmm
23+
uniform_or_localopt
24+
ax_multitask
25+
26+
.. toctree::
27+
:maxdepth: 2
28+
:caption: Modeling and Approximation
29+
30+
tasmanian
31+
fd_param_finder
32+
surmise
2333

2434
.. _libEnsemble Community Repository: https://github.com/Libensemble/libe-community-examples

docs/examples/sampling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sampling
55
:class: underline
66

77
.. automodule:: sampling
8-
:members: uniform_random_sample latin_hypercube_sample
8+
:members: uniform_random_sample, latin_hypercube_sample
99
:undoc-members:
1010

1111
.. dropdown:: :underline:`sampling.py`
@@ -17,7 +17,7 @@ sampling
1717
persistent_sampling
1818
-------------------
1919
.. automodule:: persistent_sampling
20-
:members: persistent_uniform persistent_uniform_final_update persistent_request_shutdown
20+
:members: persistent_uniform, persistent_request_shutdown, persistent_uniform_with_cancellations
2121
:undoc-members:
2222

2323
.. dropdown:: :underline:`persistent_sampling.py`

docs/examples/sim_funcs.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function launching tasks, see the
1616
six_hump_camel
1717
--------------
1818
.. automodule:: six_hump_camel
19-
:members:
19+
:members: six_hump_camel_simple, persistent_six_hump_camel
2020
:undoc-members:
2121

2222
.. dropdown:: :underline:`six_hump_camel.py`
@@ -25,12 +25,6 @@ six_hump_camel
2525
:language: python
2626
:linenos:
2727

28-
chwirut
29-
-------
30-
.. automodule:: chwirut1
31-
:members:
32-
:undoc-members:
33-
3428
noisy_vector_mapping
3529
--------------------
3630
.. automodule:: noisy_vector_mapping
@@ -43,12 +37,6 @@ noisy_vector_mapping
4337
:language: python
4438
:linenos:
4539

46-
periodic_func
47-
-------------
48-
.. automodule:: periodic_func
49-
:members:
50-
:undoc-members:
51-
5240
borehole
5341
--------
5442
.. automodule:: borehole

docs/examples/surmise.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
persistent_surmise
22
------------------
33

4-
Required: Surmise_
4+
Required: Surmise_.
5+
56
The :doc:`Borehole Calibration tutorial<../tutorials/calib_cancel_tutorial>` uses this generator as an
67
example of the capability to cancel pending simulations.
78

docs/examples/tasmanian.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use either *venv* or *--user* install.
99
``E.g: pip install scikit-build packaging Tasmanian --user``
1010

1111
.. automodule:: persistent_tasmanian
12-
:members:
12+
:members: sparse_grid_batched, sparse_grid_async
1313
:undoc-members:
1414

1515
.. role:: underline
@@ -23,4 +23,3 @@ use either *venv* or *--user* install.
2323

2424
.. _pypackaging: https://pypi.org/project/pypackaging/
2525
.. _scikit-build: https://scikit-build.readthedocs.io/en/latest/index.html
26-
.. _Tasmanian: https://tasmanian.ornl.gov/

docs/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ See the `user guide`_ for more information.
4949
.. _PETSc/TAO: http://www.mcs.anl.gov/petsc
5050
.. _scipy.optimize: https://docs.scipy.org/doc/scipy/reference/optimize.html
5151
.. _Surmise: https://surmise.readthedocs.io/en/latest/index.html
52-
.. _Tasmanian: https://tasmanian.ornl.gov/
52+
.. _Tasmanian: https://github.com/ORNL/Tasmanian
5353
.. _user guide: https://libensemble.readthedocs.io/en/latest/programming_libE.html
5454
.. _VTMOP: https://github.com/Libensemble/libe-community-examples#vtmop
5555
.. _WarpX: https://warpx.readthedocs.io/en/latest/

docs/introduction_latex.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
.. _Surmise: https://surmise.readthedocs.io/en/latest/index.html
5151
.. _SWIG: http://swig.org/
5252
.. _tarball: https://github.com/Libensemble/libensemble/releases/latest
53-
.. _Tasmanian: https://tasmanian.ornl.gov/
53+
.. _Tasmanian: https://github.com/ORNL/Tasmanian
5454
.. _tomli: https://pypi.org/project/tomli/
5555
.. _tqdm: https://tqdm.github.io/
5656
.. _user guide: https://libensemble.readthedocs.io/en/latest/programming_libE.html

docs/nitpicky

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ py:class <class 'int'>
3737
py:class +ScalarType
3838
py:class +_ScalarType_co
3939
py:class collections.abc.Sequence
40+
py:class pathlib._local.Path
4041

4142
# Internal paths that are verified importable but Sphinx can't find
4243
py:class libensemble.resources.platforms.Aurora

libensemble/gen_funcs/aposmm_localopt_support.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ class LocalOptInterfacer(object):
7575
7676
Currently supported routines are
7777
78-
- NLopt routines ['LN_SBPLX', 'LN_BOBYQA', 'LN_COBYLA', 'LN_NEWUOA', 'LN_NELDERMEAD', 'LD_MMA']
79-
- PETSc/TAO routines ['pounders', 'blmvm', 'nm']
80-
- SciPy routines ['scipy_Nelder-Mead', 'scipy_COBYLA', 'scipy_BFGS']
81-
- DFOLS ['dfols']
82-
- External local optimizer ['external_localopt'] (which use files to pass/receive x/f values)
78+
- NLopt [``'LN_SBPLX'``, ``LN_BOBYQA'``, ``'LN_COBYLA'``, ``'LN_NEWUOA'``, ``'LN_NELDERMEAD'``, ``'LD_MMA'``]
79+
- PETSc/TAO [``'pounders'``, ``'blmvm'``, ``'nm'``]
80+
- SciPy [``'scipy_Nelder-Mead'``, ``'scipy_COBYLA'``, ``'scipy_BFGS'``]
81+
- DFOLS [``'dfols'``]
82+
- External local optimizer [``'external_localopt'``] (which use files to pass/receive ``x/f`` values)
8383
"""
8484

8585
def __init__(self, user_specs, x0, f0, grad0=None):

libensemble/gen_funcs/persistent_aposmm.py

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -37,81 +37,76 @@ def cdist(XA, XB, metric="euclidean"):
3737

3838
def aposmm(H, persis_info, gen_specs, libE_info):
3939
"""
40-
APOSMM coordinates multiple local optimization runs, dramatically reducing time-to-solution
41-
on parallel systems for discovering multiple minima. APOSMM tracks these fields:
42-
43-
- ``'x' [n floats]``: Parameters being optimized over
44-
- ``'x_on_cube' [n floats]``: Parameters scaled to the unit cube
45-
- ``'f' [float]``: Objective function being minimized
46-
- ``'local_pt' [bool]``: True if point from a local optimization run
47-
- ``'dist_to_unit_bounds' [float]``: Distance to domain boundary
48-
- ``'dist_to_better_l' [float]``: Dist to closest better local opt point
49-
- ``'dist_to_better_s' [float]``: Dist to closest better sample point
50-
- ``'ind_of_better_l' [int]``: Index of point ``'dist_to_better_l``' away
51-
- ``'ind_of_better_s' [int]``: Index of point ``'dist_to_better_s``' away
52-
- ``'started_run' [bool]``: True if point has started a local opt run
53-
- ``'num_active_runs' [int]``: Number of active local runs point is in
54-
- ``'local_min' [float]``: True if point has been ruled a local minima
55-
- ``'sim_id' [int]``: Row number of entry in history
40+
APOSMM coordinates multiple local optimization runs, dramatically reducing time for
41+
discovering multiple minima on parallel systems. APOSMM tracks these fields:
42+
43+
- ``"x" [n floats]``: Parameters being optimized over
44+
- ``"x_on_cube" [n floats]``: Parameters scaled to the unit cube
45+
- ``"f" [float]``: Objective function being minimized
46+
- ``"local_pt" [bool]``: True if point from a local optimization run
47+
- ``"started_run" [bool]``: True if point has started a local opt run
48+
- ``"num_active_runs" [int]``: Number of active local runs point is in
49+
- ``"local_min" [float]``: True if point has been ruled a local minima
50+
- ``"sim_id" [int]``: Row number of entry in history
5651
5752
and optionally
5853
59-
- ``'fvec' [m floats]``: All objective components (if performing a least-squares calculation)
60-
- ``'grad' [n floats]``: The gradient (if available) of the objective with respect to `x`.
54+
- ``"fvec" [m floats]``: All objective components (if performing a least-squares calculation)
55+
- ``"grad" [n floats]``: The gradient (if available) of the objective with respect to `x`.
6156
6257
Note:
6358
6459
- If any of the above fields are desired after a libEnsemble run, name
65-
them in ``gen_specs['out']``.
60+
them in ``gen_specs["out"]``.
6661
- If intitializing APOSMM with past function values, make sure to include
67-
``'x'``, ``'x_on_cube'``, ``'f'``, ``'local_pt'``, etc. in
68-
``gen_specs['in']`` (and, of course, include them in the H0 array given
62+
``"x"``, ``"x_on_cube"``, ``"f"``, ``"local_pt"``, etc. in
63+
``gen_specs["in"]`` (and, of course, include them in the H0 array given
6964
to libensemble).
7065
71-
Necessary quantities in ``gen_specs['user']`` are:
66+
Necessary quantities in ``gen_specs["user"]`` are:
7267
73-
- ``'lb' [n floats]``: Lower bound on search domain
74-
- ``'ub' [n floats]``: Upper bound on search domain
75-
- ``'localopt_method' [str]``: Name of an NLopt, PETSc/TAO, or SciPy method
76-
(see 'advance_local_run' below for supported methods). When using a SciPy
77-
method, must supply ``'opt_return_codes'``, a list of integers that will
68+
- ``"lb" [n floats]``: Lower bound on search domain
69+
- ``"ub" [n floats]``: Upper bound on search domain
70+
- ``"localopt_method" [str]``: Name of an NLopt, PETSc/TAO, or SciPy method
71+
(see "advance_local_run" below for supported methods). When using a SciPy
72+
method, must supply ``"opt_return_codes"``, a list of integers that will
7873
be used to determine if the x produced by the localopt method should be
79-
ruled a local minimum. (For example, SciPy's COBYLA has a 'status' of 1 if
80-
at an optimum, but SciPy's Nelder-Mead and BFGS have a 'status' of 0 if at
74+
ruled a local minimum. (For example, SciPy's COBYLA has a "status" of ``1`` if
75+
at an optimum, but SciPy's Nelder-Mead and BFGS have a "status" of ``0`` if at
8176
an optimum.)
82-
- ``'initial_sample_size' [int]``: Number of uniformly sampled points
77+
- ``"initial_sample_size" [int]``: Number of uniformly sampled points
8378
to be evaluated before starting the localopt runs. Can be
8479
zero if no additional sampling is desired, but if zero there must be past
8580
sim_f values given to libEnsemble in H0.
8681
87-
Optional ``gen_specs['user']`` entries are:
82+
Optional ``gen_specs["user"]`` entries are:
8883
89-
- ``'sample_points' [numpy array]``: Points to be sampled (original domain).
84+
- ``"max_active_runs" [int]``: Bound on number of runs APOSMM is advancing
85+
- ``"sample_points" [numpy array]``: Points to be sampled (original domain).
9086
If more sample points are needed by APOSMM during the course of the
9187
optimization, points will be drawn uniformly over the domain
92-
- ``'components' [int]``: Number of objective components
93-
- ``'dist_to_bound_multiple' [float in (0, 1]]``: What fraction of the
88+
- ``"components" [int]``: Number of objective components
89+
- ``"dist_to_bound_multiple" [float in (0, 1]]``: What fraction of the
9490
distance to the nearest boundary should the initial step size be in
9591
localopt runs
96-
- ``'lhs_divisions' [int]``: Number of Latin hypercube sampling partitions
92+
- ``"lhs_divisions" [int]``: Number of Latin hypercube sampling partitions
9793
(0 or 1 results in uniform sampling)
98-
- ``'mu' [float]``: Distance from the boundary that all localopt starting
94+
- ``"mu" [float]``: Distance from the boundary that all localopt starting
9995
points must satisfy
100-
- ``'nu' [float]``: Distance from identified minima that all starting
96+
- ``"nu" [float]``: Distance from identified minima that all starting
10197
points must satisfy
102-
- ``'rk_const' [float]``: Multiplier in front of the r_k value
103-
- ``'max_active_runs' [int]``: Bound on number of runs APOSMM is advancing
104-
- ``'stop_after_k_minima' [int]``: Tell APOSMM to stop after this many
98+
- ``"rk_const" [float]``: Multiplier in front of the ``r_k`` value
99+
- ``"stop_after_k_minima" [int]``: Tell APOSMM to stop after this many
105100
local minima have been identified by a local optimization run.
106-
- ``'stop_after_k_runs' [int]``: Tell APOSMM to stop after this many runs
101+
- ``"stop_after_k_runs" [int]``: Tell APOSMM to stop after this many runs
107102
have ended. (The number of ended runs may be less than the number of
108103
minima if, for example, a local optimization run ends due to a evaluation
109104
constraint, but not convergence criteria.)
110105
111106
If the rules in ``decide_where_to_start_localopt`` produces more than
112-
``'max_active_runs'`` in some iteration, then existing runs are prioritized.
107+
``"max_active_runs"`` in some iteration, then existing runs are prioritized.
113108
114-
And ``gen_specs['user']`` must also contain fields for the given
109+
And ``gen_specs["user"]`` must also contain fields for the given
115110
localopt_method's convergence tolerances (e.g., ``gatol/grtol`` for PETSC/TAO
116111
or ``ftol_rel`` for NLopt)
117112

0 commit comments

Comments
 (0)