amm-optimizer 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amm/__init__.py +31 -0
- amm_optimizer-0.2.0.dist-info/METADATA +406 -0
- amm_optimizer-0.2.0.dist-info/RECORD +37 -0
- amm_optimizer-0.2.0.dist-info/WHEEL +4 -0
- amm_optimizer-0.2.0.dist-info/licenses/LICENSE +201 -0
- atm/__init__.py +19 -0
- atm/api.py +1603 -0
- atm/basin_phase.py +271 -0
- atm/bounds.py +87 -0
- atm/chain_phase.py +588 -0
- atm/cma_phase.py +736 -0
- atm/cobyqa_phase.py +157 -0
- atm/conductor.py +71 -0
- atm/config.py +1232 -0
- atm/control.py +169 -0
- atm/es_phase.py +707 -0
- atm/hyperparams.py +75 -0
- atm/legacy_stream.py +67 -0
- atm/meta.py +82 -0
- atm/nm_phase.py +81 -0
- atm/objective.py +211 -0
- atm/plan.py +90 -0
- atm/pop_cma.py +313 -0
- atm/presets.py +269 -0
- atm/profiling.py +244 -0
- atm/py.typed +0 -0
- atm/qn_phase.py +1678 -0
- atm/regimes.py +107 -0
- atm/restart.py +75 -0
- atm/result.py +19 -0
- atm/sampler.py +287 -0
- atm/search.py +172 -0
- atm/section.py +309 -0
- atm/simplex.py +223 -0
- atm/state.py +116 -0
- atm/step_phase.py +233 -0
- atm/surrogate.py +315 -0
amm/__init__.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""AMM: budget-aware routing of classical solvers by online probes.
|
|
2
|
+
|
|
3
|
+
``amm`` is the public name of this package; the implementation lives in ``atm`` (its code name,
|
|
4
|
+
kept so that every recorded result and test stays bit-exact). Everything here is the same object:
|
|
5
|
+
|
|
6
|
+
import amm
|
|
7
|
+
cfg = amm.presets.get("c46") # the configuration frozen for the paper
|
|
8
|
+
result = amm.minimize(f, x0, budget=100 * len(x0), seed=0, config=cfg, bounds=(-5, 5))
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from atm import ( # noqa: F401 (re-exports)
|
|
12
|
+
ATMConfig,
|
|
13
|
+
OptimizeResult,
|
|
14
|
+
Profiler,
|
|
15
|
+
Timings,
|
|
16
|
+
TimingProfiler,
|
|
17
|
+
__version__,
|
|
18
|
+
minimize,
|
|
19
|
+
presets,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"ATMConfig",
|
|
24
|
+
"OptimizeResult",
|
|
25
|
+
"Profiler",
|
|
26
|
+
"Timings",
|
|
27
|
+
"TimingProfiler",
|
|
28
|
+
"minimize",
|
|
29
|
+
"presets",
|
|
30
|
+
"__version__",
|
|
31
|
+
]
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: amm-optimizer
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: AMM: budget-aware routing of classical derivative-free solvers by online landscape probes (import amm, or atm)
|
|
5
|
+
Project-URL: Homepage, https://github.com/BjBodner/amm-optimizer
|
|
6
|
+
Project-URL: Source, https://github.com/BjBodner/amm-optimizer
|
|
7
|
+
Project-URL: Issues, https://github.com/BjBodner/amm-optimizer/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/BjBodner/amm-optimizer/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Benjy Bodner
|
|
10
|
+
License: Apache License
|
|
11
|
+
Version 2.0, January 2004
|
|
12
|
+
http://www.apache.org/licenses/
|
|
13
|
+
|
|
14
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
15
|
+
|
|
16
|
+
1. Definitions.
|
|
17
|
+
|
|
18
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
19
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
20
|
+
|
|
21
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
22
|
+
the copyright owner that is granting the License.
|
|
23
|
+
|
|
24
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
25
|
+
other entities that control, are controlled by, or are under common
|
|
26
|
+
control with that entity. For the purposes of this definition,
|
|
27
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
28
|
+
direction or management of such entity, whether by contract or
|
|
29
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
30
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
31
|
+
|
|
32
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
33
|
+
exercising permissions granted by this License.
|
|
34
|
+
|
|
35
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
36
|
+
including but not limited to software source code, documentation
|
|
37
|
+
source, and configuration files.
|
|
38
|
+
|
|
39
|
+
"Object" form shall mean any form resulting from mechanical
|
|
40
|
+
transformation or translation of a Source form, including but
|
|
41
|
+
not limited to compiled object code, generated documentation,
|
|
42
|
+
and conversions to other media types.
|
|
43
|
+
|
|
44
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
45
|
+
Object form, made available under the License, as indicated by a
|
|
46
|
+
copyright notice that is included in or attached to the work
|
|
47
|
+
(an example is provided in the Appendix below).
|
|
48
|
+
|
|
49
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
50
|
+
form, that is based on (or derived from) the Work and for which the
|
|
51
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
52
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
53
|
+
of this License, Derivative Works shall not include works that remain
|
|
54
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
55
|
+
the Work and Derivative Works thereof.
|
|
56
|
+
|
|
57
|
+
"Contribution" shall mean any work of authorship, including
|
|
58
|
+
the original version of the Work and any modifications or additions
|
|
59
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
60
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
61
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
62
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
63
|
+
means any form of electronic, verbal, or written communication sent
|
|
64
|
+
to the Licensor or its representatives, including but not limited to
|
|
65
|
+
communication on electronic mailing lists, source code control systems,
|
|
66
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
67
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
68
|
+
excluding communication that is conspicuously marked or otherwise
|
|
69
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
70
|
+
|
|
71
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
72
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
73
|
+
subsequently incorporated within the Work.
|
|
74
|
+
|
|
75
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
79
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
80
|
+
Work and such Derivative Works in Source or Object form.
|
|
81
|
+
|
|
82
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
83
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
84
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
85
|
+
(except as stated in this section) patent license to make, have made,
|
|
86
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
87
|
+
where such license applies only to those patent claims licensable
|
|
88
|
+
by such Contributor that are necessarily infringed by their
|
|
89
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
90
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
91
|
+
institute patent litigation against any entity (including a
|
|
92
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
93
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
94
|
+
or contributory patent infringement, then any patent licenses
|
|
95
|
+
granted to You under this License for that Work shall terminate
|
|
96
|
+
as of the date such litigation is filed.
|
|
97
|
+
|
|
98
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
99
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
100
|
+
modifications, and in Source or Object form, provided that You
|
|
101
|
+
meet the following conditions:
|
|
102
|
+
|
|
103
|
+
(a) You must give any other recipients of the Work or
|
|
104
|
+
Derivative Works a copy of this License; and
|
|
105
|
+
|
|
106
|
+
(b) You must cause any modified files to carry prominent notices
|
|
107
|
+
stating that You changed the files; and
|
|
108
|
+
|
|
109
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
110
|
+
that You distribute, all copyright, patent, trademark, and
|
|
111
|
+
attribution notices from the Source form of the Work,
|
|
112
|
+
excluding those notices that do not pertain to any part of
|
|
113
|
+
the Derivative Works; and
|
|
114
|
+
|
|
115
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
116
|
+
distribution, then any Derivative Works that You distribute must
|
|
117
|
+
include a readable copy of the attribution notices contained
|
|
118
|
+
within such NOTICE file, excluding those notices that do not
|
|
119
|
+
pertain to any part of the Derivative Works, in at least one
|
|
120
|
+
of the following places: within a NOTICE text file distributed
|
|
121
|
+
as part of the Derivative Works; within the Source form or
|
|
122
|
+
documentation, if provided along with the Derivative Works; or,
|
|
123
|
+
within a display generated by the Derivative Works, if and
|
|
124
|
+
wherever such third-party notices normally appear. The contents
|
|
125
|
+
of the NOTICE file are for informational purposes only and
|
|
126
|
+
do not modify the License. You may add Your own attribution
|
|
127
|
+
notices within Derivative Works that You distribute, alongside
|
|
128
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
129
|
+
that such additional attribution notices cannot be construed
|
|
130
|
+
as modifying the License.
|
|
131
|
+
|
|
132
|
+
You may add Your own copyright statement to Your modifications and
|
|
133
|
+
may provide additional or different license terms and conditions
|
|
134
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
135
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
136
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
137
|
+
the conditions stated in this License.
|
|
138
|
+
|
|
139
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
140
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
141
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
142
|
+
this License, without any additional terms or conditions.
|
|
143
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
144
|
+
the terms of any separate license agreement you may have executed
|
|
145
|
+
with Licensor regarding such Contributions.
|
|
146
|
+
|
|
147
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
148
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
149
|
+
except as required for reasonable and customary use in describing the
|
|
150
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
151
|
+
|
|
152
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
153
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
154
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
155
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
156
|
+
implied, including, without limitation, any warranties or conditions
|
|
157
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
158
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
159
|
+
appropriateness of using or redistributing the Work and assume any
|
|
160
|
+
risks associated with Your exercise of permissions under this License.
|
|
161
|
+
|
|
162
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
163
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
164
|
+
unless required by applicable law (such as deliberate and grossly
|
|
165
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
166
|
+
liable to You for damages, including any direct, indirect, special,
|
|
167
|
+
incidental, or consequential damages of any character arising as a
|
|
168
|
+
result of this License or out of the use or inability to use the
|
|
169
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
170
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
171
|
+
other commercial damages or losses), even if such Contributor
|
|
172
|
+
has been advised of the possibility of such damages.
|
|
173
|
+
|
|
174
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
175
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
176
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
177
|
+
or other liability obligations and/or rights consistent with this
|
|
178
|
+
License. However, in accepting such obligations, You may act only
|
|
179
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
180
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
181
|
+
defend, and hold each Contributor harmless for any liability
|
|
182
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
183
|
+
of your accepting any such warranty or additional liability.
|
|
184
|
+
|
|
185
|
+
END OF TERMS AND CONDITIONS
|
|
186
|
+
|
|
187
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
188
|
+
|
|
189
|
+
To apply the Apache License to your work, attach the following
|
|
190
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
191
|
+
replaced with your own identifying information. (Don't include
|
|
192
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
193
|
+
comment syntax for the file format. We also recommend that a
|
|
194
|
+
file or class name and description of purpose be included on the
|
|
195
|
+
same "printed page" as the copyright notice for easier
|
|
196
|
+
identification within third-party archives.
|
|
197
|
+
|
|
198
|
+
Copyright [yyyy] [name of copyright owner]
|
|
199
|
+
|
|
200
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
201
|
+
you may not use this file except in compliance with the License.
|
|
202
|
+
You may obtain a copy of the License at
|
|
203
|
+
|
|
204
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
205
|
+
|
|
206
|
+
Unless required by applicable law or agreed to in writing, software
|
|
207
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
208
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
209
|
+
See the License for the specific language governing permissions and
|
|
210
|
+
limitations under the License.
|
|
211
|
+
License-File: LICENSE
|
|
212
|
+
Keywords: BBOB,CMA-ES,COCO,algorithm selection,black-box optimization,derivative-free
|
|
213
|
+
Classifier: Development Status :: 4 - Beta
|
|
214
|
+
Classifier: Intended Audience :: Science/Research
|
|
215
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
216
|
+
Classifier: Programming Language :: Python :: 3
|
|
217
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
218
|
+
Requires-Python: >=3.10
|
|
219
|
+
Requires-Dist: numpy>=1.23
|
|
220
|
+
Requires-Dist: scipy>=1.16
|
|
221
|
+
Provides-Extra: bench
|
|
222
|
+
Requires-Dist: coco-experiment; extra == 'bench'
|
|
223
|
+
Requires-Dist: cocopp; extra == 'bench'
|
|
224
|
+
Provides-Extra: dev
|
|
225
|
+
Requires-Dist: hypothesis; extra == 'dev'
|
|
226
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
227
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
228
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
229
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
230
|
+
Description-Content-Type: text/markdown
|
|
231
|
+
|
|
232
|
+
# AMM: budget-aware routing of classical solvers by online probes
|
|
233
|
+
|
|
234
|
+
AMM is a derivative-free optimizer for continuous black-box problems with a **known evaluation
|
|
235
|
+
budget** and a **known box**. It does not run one algorithm: it spends a small, counted part of the
|
|
236
|
+
budget on *online probes* (curvature, plateau, separability, kink, basin and fractal readings of the
|
|
237
|
+
objective near the incumbent) and uses their outcomes to route the rest of the budget among
|
|
238
|
+
quasi-Newton (SLSQP, L-BFGS-B), trust-region (COBYQA), coordinate (STEP), multistart (MLSL) and
|
|
239
|
+
population (CMA-ES family, the ATM sampler) engines. A probe that does not fire leaves the run on
|
|
240
|
+
a general path, so a misreading costs evaluations, not the run. Every rule reads only the
|
|
241
|
+
dimension, the budget, the box and evaluated function values.
|
|
242
|
+
|
|
243
|
+
The method, its development protocol and its evaluation on COCO/bbob are described in the paper
|
|
244
|
+
(citation below). The package was developed under the code name ATM; the implementation therefore
|
|
245
|
+
lives in `atm`, and `amm` is an alias for the same objects.
|
|
246
|
+
|
|
247
|
+
## Install
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
pip install amm-optimizer # NumPy and SciPy only
|
|
251
|
+
pip install -e ".[dev]" # from a checkout; add ",bench" for the COCO/bbob tooling
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Quick start (the configuration frozen for the paper)
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
import numpy as np
|
|
258
|
+
import amm # `import atm` is equivalent
|
|
259
|
+
|
|
260
|
+
def f(x):
|
|
261
|
+
return float(np.sum((x - 1.0) ** 2))
|
|
262
|
+
|
|
263
|
+
result = amm.minimize(
|
|
264
|
+
f,
|
|
265
|
+
x0=np.zeros(10),
|
|
266
|
+
budget=100 * 10, # maximum number of function evaluations
|
|
267
|
+
seed=0, # runs are deterministic given the seed
|
|
268
|
+
bounds=(-5, 5), # required: the box (scalars or one value per coordinate)
|
|
269
|
+
config=amm.presets.get("c46"), # the frozen configuration; see docs/FREEZE_2026-10-22.md
|
|
270
|
+
)
|
|
271
|
+
print(result.x, result.fun, result.nfev)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
`bounds` is required by this preset (it raises `ValueError` without it). The box is used, not
|
|
275
|
+
enforced as a constraint: samples are folded into it before the function is called. The objective
|
|
276
|
+
must be deterministic. Tested on noiseless, continuous, box-constrained problems with budgets of
|
|
277
|
+
10 to 1000 x the dimension.
|
|
278
|
+
|
|
279
|
+
**Reproducing the paper.** The code is that of git tag `freeze-2026-10-22`; the configuration hash of
|
|
280
|
+
`amm.presets.get("c46").config_hash()` is `2153948ebed51150`. Pre-registrations and result notes of
|
|
281
|
+
every batch are in `docs/research/batches/`, and `docs/FREEZE_2026-10-22.md` records what was frozen
|
|
282
|
+
and why.
|
|
283
|
+
|
|
284
|
+
**Citation.** See `CITATION.cff` (the paper's reference will be added when it is public).
|
|
285
|
+
|
|
286
|
+
## Legacy ATM presets
|
|
287
|
+
|
|
288
|
+
The sections below document the original ATM sampler and the older presets
|
|
289
|
+
(`ATMConfig()`, `composite()`, `improved()`); they are kept because every recorded result and test
|
|
290
|
+
depends on them. This repository is a clean, tested re-implementation of the original ATM that
|
|
291
|
+
reproduces its results exactly (see [docs/DEVIATIONS.md](docs/DEVIATIONS.md)).
|
|
292
|
+
|
|
293
|
+
```python
|
|
294
|
+
import numpy as np
|
|
295
|
+
import atm
|
|
296
|
+
|
|
297
|
+
def sphere(x):
|
|
298
|
+
return np.sum((x - 2) ** 2)
|
|
299
|
+
|
|
300
|
+
result = atm.minimize(sphere, x0=np.zeros(10), budget=2000, seed=0)
|
|
301
|
+
print(result.x, result.fun, result.nfev)
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`budget` is the maximum number of function evaluations, and ATM uses all of them (the
|
|
305
|
+
best point found is kept even if the budget ends mid-iteration). Pass `seed=` (or an
|
|
306
|
+
`rng=np.random.RandomState`) for reproducible runs. A starting point where the function is
|
|
307
|
+
NaN or infinite raises `ValueError`; NaN or infinite values elsewhere count as failed
|
|
308
|
+
evaluations and never win.
|
|
309
|
+
|
|
310
|
+
The defaults reproduce the original ATM exactly (see `docs/DEVIATIONS.md`);
|
|
311
|
+
`ATMConfig(strict_budget=False)` also restores the original's looser budget accounting.
|
|
312
|
+
|
|
313
|
+
## Better results: the improved preset
|
|
314
|
+
|
|
315
|
+
If you know the search box, `ATMConfig.improved()` gets far more out of the same budget:
|
|
316
|
+
|
|
317
|
+
```python
|
|
318
|
+
result = atm.minimize(
|
|
319
|
+
sphere,
|
|
320
|
+
x0=np.zeros(10),
|
|
321
|
+
budget=2000,
|
|
322
|
+
seed=0,
|
|
323
|
+
bounds=(-5, 5), # scalars or one value per coordinate
|
|
324
|
+
config=atm.ATMConfig.improved(),
|
|
325
|
+
)
|
|
326
|
+
print(result.fun)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The box is used, not enforced as a constraint: samples are folded back into it before the
|
|
330
|
+
function is called, so the function only ever sees points inside. Without `bounds=` the
|
|
331
|
+
preset raises `ValueError`. The objective must be deterministic.
|
|
332
|
+
|
|
333
|
+
**This preset is a hybrid, not just ATM.** It takes ATM's sampler with five improvements
|
|
334
|
+
(success-rate control of the search width, a uniform first pool over the box, bounds folded
|
|
335
|
+
with a 25 % corner clip, a pool sized from the budget, no re-evaluation of the incumbent) and
|
|
336
|
+
adds local-search stages: a simplex search in up to 4 dimensions and a (1+1)-ES above, for the
|
|
337
|
+
first part of small budgets; a learned covariance up to 10 dimensions; and, up to 10
|
|
338
|
+
dimensions, a simplex search over the last half of the budget. Each option is documented in
|
|
339
|
+
`docs/DEVIATIONS.md` and `docs/EXPERIMENTS.md`.
|
|
340
|
+
|
|
341
|
+
Presets, from simplest to largest:
|
|
342
|
+
|
|
343
|
+
| Preset | What it is | Evidence |
|
|
344
|
+
|---|---|---|
|
|
345
|
+
| `ATMConfig()` | the original ATM, bit for bit | `tests/golden`, 400-case parity sweep |
|
|
346
|
+
| `ATMConfig.composite()` | ATM's sampler plus the five improvements; stays pure ATM | +.101, +.097, +.099 on three untouched holdouts |
|
|
347
|
+
| `ATMConfig.improved()` | the composite plus the local stages above (recommended) | +.196 over the original, +.096 over the composite on a fourth holdout |
|
|
348
|
+
| `ATMConfig.improved_wave6()` | an earlier version, kept for reproducibility; loses on multimodal functions at medium budgets | Tier 4, `docs/HOLDOUT_TIER4.md` |
|
|
349
|
+
|
|
350
|
+
`tests/golden/presets.json` pins the exact cost traces of all of them.
|
|
351
|
+
|
|
352
|
+
**What to expect from `improved()`**, measured on COCO bbob (2021 suite) instances 96-100 that
|
|
353
|
+
were not used to design it (`docs/HOLDOUT_TIER5.md`, 18,000 runs per arm, raw COCO evaluation):
|
|
354
|
+
|
|
355
|
+
* ECDF value (fraction of targets reached) improves by **+.196** [95 % CI +.180, +.212] over
|
|
356
|
+
the defaults, averaged over budgets of 30, 100 and 300 x dimension, and by **+.096**
|
|
357
|
+
[+.085, +.108] over `composite()`.
|
|
358
|
+
* The gain shrinks as the dimension grows: over the defaults +.412 at D = 2, +.197 at D = 5,
|
|
359
|
+
+.127 at D = 10, +.082 at D = 20, +.055 at D = 40; over `composite()` +.215 at D = 2 down to
|
|
360
|
+
+.017 at D = 40, where the two are almost the same algorithm.
|
|
361
|
+
* It does **not** beat everything: a plain (1+1)-ES with the 1/5 rule is still ahead at 40
|
|
362
|
+
dimensions (-.031) and level at 20, and CMA-ES is far ahead of every ATM variant at large
|
|
363
|
+
budgets (on the Tier 4 instances: .597 against .504 for the closest hybrid at 1000 x D).
|
|
364
|
+
* Only noiseless, continuous, box-constrained problems with budgets of 10 to 1000 x D were
|
|
365
|
+
tested. The three-algorithm design means its gain should not be described as an improvement
|
|
366
|
+
of ATM's sampler alone; use `composite()` if you want that.
|
|
367
|
+
|
|
368
|
+
## Development
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
pytest -m "not slow" # fast suite, includes golden-master and parity tests
|
|
372
|
+
pytest -m slow # 400 random cases against the frozen original in reference/
|
|
373
|
+
python tools/record_golden.py # re-record golden masters (only for deliberate changes)
|
|
374
|
+
python benchmarks/perf.py # repeatable speed benchmark, original vs this package
|
|
375
|
+
python benchmarks/block_profile.py # where the time goes, per algorithm block
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
| Path | What it is |
|
|
379
|
+
|------|------------|
|
|
380
|
+
| `src/atm/` | the package |
|
|
381
|
+
| `reference/` | byte-identical copy of the original module, used only by tests |
|
|
382
|
+
| `tests/golden/` | recorded trajectories from the original |
|
|
383
|
+
| `docs/AUDIT.md` | audit of the original, with severity and evidence |
|
|
384
|
+
| `docs/REFACTOR_PLAN.md` | phases, principles, definition of done |
|
|
385
|
+
| `docs/DEVIATIONS.md` | every difference from the original |
|
|
386
|
+
| `docs/PERF.md` | speed measurements, method and repeatability |
|
|
387
|
+
| `docs/BENCHMARKS.md` | COCO protocol, harness usage, parity and profiling results |
|
|
388
|
+
| `docs/EXPERIMENTS.md` | prioritized, lightweight experiments to improve ATM on bbob (protocol, cards, log) |
|
|
389
|
+
| `docs/research/` | literature report, code-review report and their notes |
|
|
390
|
+
| `docs/WORKPLAN.md` | scan of the codebase and the plan for readability, tests, extensibility, profiling |
|
|
391
|
+
| `benchmarks/` | speed harness (`perf.py`), per-block timing (`block_profile.py`), COCO/bbob harness (`run_bbob.py`, `compare_bbob.py`, `postprocess_bbob.py`) and stored results |
|
|
392
|
+
|
|
393
|
+
## CI runs on your laptop
|
|
394
|
+
|
|
395
|
+
There is deliberately no GitHub Actions CI for now (it would use Actions minutes). Run the same checks locally with the project's virtual environment:
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
.venv\Scripts\python tools/ci.py # fast gate, about 2 minutes: lint, format, types, quick tests
|
|
399
|
+
.venv\Scripts\python tools/ci.py --full # about 3 minutes (longer on a busy machine): all tests incl. the 400-case parity sweep, 100 % coverage gate
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Both stop at the first failing step and exit non-zero (`--keep-going` runs everything). To run the fast gate automatically before every `git push`, opt in with `git config core.hooksPath .githooks` (undo with `git config --unset core.hooksPath`; skip once with `git push --no-verify`). It is not enabled by default.
|
|
403
|
+
|
|
404
|
+
A GitHub Actions workflow is parked, switched to manual start, in `ci/github-actions-ci.yml`; moving it to `.github/workflows/` needs a token with the `workflow` scope.
|
|
405
|
+
|
|
406
|
+
Licensed under Apache-2.0.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
amm/__init__.py,sha256=JkXdzHr0eXp3-DvNpd8PXuFxUiwRXyQBjPXnZaN3Aac,785
|
|
2
|
+
atm/__init__.py,sha256=DSE7mUhLAJP6f3VK-Zj8NORPjEfTY9ueMzSxjFVPX0w,420
|
|
3
|
+
atm/api.py,sha256=rPqGUhGXg_n-1RWmrcP9f_qqYdkg7iD665tgu8NxPbg,64965
|
|
4
|
+
atm/basin_phase.py,sha256=mT3I7pr8k_BHF8iEPsSeXHsy_1wrJ1TB_ZzCpDT6rfo,11128
|
|
5
|
+
atm/bounds.py,sha256=o3VrjuA-5FGuVY2zBKm42NKGJUN9umO4YtiLaWDRD5I,3431
|
|
6
|
+
atm/chain_phase.py,sha256=s99AskWn3mE1gcyN79Fdbf0dOaBOvfSQuYlxP0ppmsQ,21831
|
|
7
|
+
atm/cma_phase.py,sha256=qOJGFRMkzH7jqNeTdCFwPJBanaahAu2ffVdJPv0aBCA,29626
|
|
8
|
+
atm/cobyqa_phase.py,sha256=dR3cVCpOSlVkhXiGPjrQnmeUp_UJXRVYtrE3blezYo8,5608
|
|
9
|
+
atm/conductor.py,sha256=QhTSzKaJqMESlB458EcJFKygSaGUbmfdt8lDLeskWJo,2940
|
|
10
|
+
atm/config.py,sha256=afRYpO2uFREC1s2PbxTBpINiEqKt8x3LR3dI4xaTapU,66439
|
|
11
|
+
atm/control.py,sha256=kSfgQajIAy_2aUnXow8zEbvW3ZCo_9voZz99xTOm8ys,6747
|
|
12
|
+
atm/es_phase.py,sha256=_b8skwQnEojYqZfwl_8hYmkLC9jNHyoEUAUA0szZBOo,28792
|
|
13
|
+
atm/hyperparams.py,sha256=Y8jDKVozefYRvV4lLBdVRsQftpW9kDYXIj1cGT-V1T4,2227
|
|
14
|
+
atm/legacy_stream.py,sha256=WrXkI0o4wFSzrPU1mBFNrJHTKdMhtVRuGYexxMwvp1s,2968
|
|
15
|
+
atm/meta.py,sha256=BmbkWMAjbhkuDerWMPxrpNkV9En4Fvs-MjiNwZkhDaw,3208
|
|
16
|
+
atm/nm_phase.py,sha256=5cCN8B7G9sxNLggy4ZsFqcFOZN7K4rRHZa0_H-SeGB0,2714
|
|
17
|
+
atm/objective.py,sha256=P0M8jvruprFhgOtYAomgT0w65YZX9tYduBYRXEnMho0,7542
|
|
18
|
+
atm/plan.py,sha256=KzhE0ygM66MFGGHAv3D99cUj9TXgCBlMkranLM2HcWM,3475
|
|
19
|
+
atm/pop_cma.py,sha256=7NMNfYdE7V2l7L8tQxyKKn2wzBNzDZkCer1WeLCvRzU,13315
|
|
20
|
+
atm/presets.py,sha256=5tIppn8wf94HzGanAe12FrxaWvUq2GfqYnHJ1lOA8WE,12798
|
|
21
|
+
atm/profiling.py,sha256=B8nB4G6UVYLT_zoRet4EVk76t5JFTTnax8GyiEIVZb0,7849
|
|
22
|
+
atm/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
+
atm/qn_phase.py,sha256=p05E38P8W-WKcV3OxefH3_rnJ7_8bvzA3iHklIXXPZA,73366
|
|
24
|
+
atm/regimes.py,sha256=k0WKLmvRbfZx3IpwLThBQscRwlJyeipiHoPGnmfActc,3627
|
|
25
|
+
atm/restart.py,sha256=RLM855iQHeKxObchjGD1N5sP1MpdiJ3toVfN6rvogi8,2222
|
|
26
|
+
atm/result.py,sha256=ZzhEQmxldPQ_qBy5pooS3pFnSX3hsoQtXCKFDJKSKm8,379
|
|
27
|
+
atm/sampler.py,sha256=ZwB53DZgQMUfyr5bomtOaAsuZnbhUKfl0K6jPz-GB_g,11152
|
|
28
|
+
atm/search.py,sha256=4eAfeoV8-0tkm6RDKwAPQKB0ooW-la-qM_Z5INC3COc,6342
|
|
29
|
+
atm/section.py,sha256=U55Q6UTObR6Y44XxXg83RHrEeXJEBS1gCp_LM-DrBtk,12510
|
|
30
|
+
atm/simplex.py,sha256=JxPVqfEGECm5iVyqWx3riW8QWA9m8N1oZQbYKm8MXkY,8456
|
|
31
|
+
atm/state.py,sha256=fw94OYTIL0jkf8SNPuozcEY1uc-fx2hK2SsDeiGRVVI,4329
|
|
32
|
+
atm/step_phase.py,sha256=jhWAZZUz-zYVjsPE3igKXgHMKUNoVqVHDn1fWGXT-ZY,10702
|
|
33
|
+
atm/surrogate.py,sha256=MW7q9DSEIrx-Jxho5uOwFOWDSWpa5-wYwA1URAfkPM0,13058
|
|
34
|
+
amm_optimizer-0.2.0.dist-info/METADATA,sha256=LKvrJxbYMqWDDvKfgrb0clZ0-QEqR-gantAiCe9iKUk,23586
|
|
35
|
+
amm_optimizer-0.2.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
36
|
+
amm_optimizer-0.2.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
37
|
+
amm_optimizer-0.2.0.dist-info/RECORD,,
|