@@ -37,81 +37,76 @@ def cdist(XA, XB, metric="euclidean"):
3737
3838def 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