1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
|
%global _empty_manifest_terminate_build 0
Name: python-openbox
Version: 0.8.1
Release: 1
Summary: Efficient and generalized blackbox optimization (BBO) system
License: MIT License Copyright (c) 2023 DAIR Lab @ Peking University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The OpenBox license applies to all parts of OpenBox that are not externally maintained codes. The externally maintained codes used by OpenBox are parts of: - base surrogates, located at openbox/surrogate/base/, - acquisition functions, located at openbox/acquisition_function/acquisition.py, - acquisition optimizers, located at openbox/acq_optimizer/, are licensed as follows: ''' SMAC License ============ ============ BSD 3-Clause License Copyright (c) 2016-2018, Ml4AAD Group (http://www.ml4aad.org/) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. License of other files ====================== ====================== RoBO ==== Gaussian process files are built on code from RoBO and/or are copied from RoBO: https://github.com/automl/RoBO smac/epm/gaussian_process.py smac/epm/gaussian_process_mcmc.py smac/epm/gp_base_prior.py smac/epm/gp_default_priors.py License: Copyright (c) 2015, automl All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of RoBO nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. '''
URL: https://pypi.org/project/openbox/
Source0: https://mirrors.aliyun.com/pypi/web/packages/95/24/d94e6bd4174cfe891b4357ea69dde7391123639f73a9503ae45ae90b89b7/openbox-0.8.1.tar.gz
BuildArch: noarch
Requires: python3-cython
Requires: python3-psutil
Requires: python3-setuptools
Requires: python3-requests
Requires: python3-tqdm
Requires: python3-prettytable
Requires: python3-colorama
Requires: python3-matplotlib
Requires: python3-pandas
Requires: python3-numpy
Requires: python3-scipy
Requires: python3-scikit-learn
Requires: python3-scikit-optimize
Requires: python3-ConfigSpace
Requires: python3-emcee
Requires: python3-statsmodels
Requires: python3-platypus-opt
Requires: python3-setuptools
Requires: python3-build
Requires: python3-wheel
Requires: python3-twine
Requires: python3-pytest
Requires: python3-pytest-cov
Requires: python3-docutils
Requires: python3-sphinx
Requires: python3-myst-parser
Requires: python3-linkify-it-py
Requires: python3-furo
Requires: python3-sphinx-copybutton
Requires: python3-sphinx-notfound-page
Requires: python3-sphinx-hoverxref
Requires: python3-setuptools
Requires: python3-build
Requires: python3-wheel
Requires: python3-twine
Requires: python3-docutils
Requires: python3-sphinx
Requires: python3-myst-parser
Requires: python3-linkify-it-py
Requires: python3-furo
Requires: python3-sphinx-copybutton
Requires: python3-sphinx-notfound-page
Requires: python3-sphinx-hoverxref
Requires: python3-pyrfr
Requires: python3-shap
Requires: python3-lightgbm
Requires: python3-hiplot
Requires: python3-cma
Requires: python3-django
Requires: python3-pymongo
Requires: python3-bson
Requires: python3-pyjwt
Requires: python3-pyrfr
Requires: python3-shap
Requires: python3-lightgbm
Requires: python3-hiplot
Requires: python3-cma
Requires: python3-pytest
Requires: python3-pytest-cov
%description
[](
https://github.com/PKU-DAIR/open-box/blob/master/LICENSE)
[](
https://github.com/PKU-DAIR/open-box/issues?q=is%3Aissue+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/pulls?q=is%3Apr+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/releases)
[](https://github.com/PKU-DAIR/open-box/actions/workflows/test.yml)
[](
https://open-box.readthedocs.io/)
[OpenBox Documentation](https://open-box.readthedocs.io)
| [OpenBox中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
| [中文README](https://github.com/PKU-DAIR/open-box/blob/master/README_zh_CN.md)
## OpenBox: Generalized and Efficient Blackbox Optimization System
**OpenBox** is an efficient and generalized blackbox optimization (BBO) system, which supports the following
characteristics: 1) **BBO with multiple objectives and constraints**, 2) **BBO with transfer learning**, 3)
**BBO with distributed parallelization**, 4) **BBO with multi-fidelity acceleration** and 5) **BBO with early stops**.
OpenBox is designed and developed by the AutoML team from the [DAIR Lab](http://net.pku.edu.cn/~cuibin/) at Peking
University, and its goal is to make blackbox optimization easier to apply both in industry and academia, and help
facilitate data science.
## Software Artifacts
#### Standalone Python package.
Users can install the released package and use it with Python.
#### Distributed BBO service.
We adopt the "BBO as a service" paradigm and implement OpenBox as a managed general service for black-box optimization.
Users can access this service via REST API conveniently, and do not need to worry about other issues such as environment
setup, software maintenance, programming, and optimization of the execution. Moreover, we also provide a Web UI,
through which users can easily track and manage the tasks.
## Design Goal
The design of OpenBox follows the following principles:
+ **Ease of use**: Minimal user effort, and user-friendly visualization for tracking and managing BBO tasks.
+ **Consistent performance**: Host state-of-the-art optimization algorithms; Choose the proper algorithm automatically.
+ **Resource-aware management**: Give cost-model-based advice to users, e.g., minimal workers or time-budget.
+ **Scalability**: Scale to dimensions on the number of input variables, objectives, tasks, trials, and parallel
evaluations.
+ **High efficiency**: Effective use of parallel resources, system optimization with transfer-learning and
multi-fidelities, etc.
+ **Fault tolerance**, **extensibility**, and **data privacy protection**.
## Links
+ [Documentations](https://open-box.readthedocs.io/en/latest/) |
[中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
+ [Examples](https://github.com/PKU-DAIR/open-box/tree/master/examples)
+ [Pypi package](https://pypi.org/project/openbox/)
+ Conda package: [to appear soon]()
+ Blog post: [to appear soon]()
<!-- start of news (for docs) -->
## News
+ **OpenBox** based solutions achieved the **First Place** of
[ACM CIKM 2021 AnalyticCup](https://www.cikm2021.org/analyticup)
(Track - Automated Hyperparameter Optimization of Recommendation System).
+ **OpenBox** team won the **Top Prize (special prize)** in the open-source innovation competition at
[2021 CCF ChinaSoft](http://chinasoft.ccf.org.cn/papers/chinasoft.html) conference.
+ [**Pasca**](https://github.com/PKU-DAIR/SGL), which adopts Openbox to support neural architecture search
functionality, won the **Best Student Paper Award at WWW'22**.
<!-- end of news (for docs) -->
## OpenBox Capabilities in a Glance
<table>
<tbody>
<tr align="center" valign="bottom">
<td>
<b>Build-in Optimization Components</b>
</td>
<td>
<b>Optimization Algorithms</b>
</td>
<td>
<b>Optimization Services</b>
</td>
</tr>
<tr valign="top">
<td>
<ul><li><b>Surrogate Model</b></li>
<ul>
<li>Gaussian Process</li>
<li>TPE</li>
<li>Probabilistic Random Forest</li>
<li>LightGBM</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Function</b></li>
<ul>
<li>EI</li>
<li>PI</li>
<li>UCB</li>
<li>MES</li>
<li>EHVI</li>
<li>TS</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Optimizer</b></li>
<ul>
<li>Random Search</li>
<li>Local Search</li>
<li>Interleaved RS and LS</li>
<li>Differential Evolution</li>
<li>L-BFGS-B</li>
</ul>
</ul>
</td>
<td align="left" >
<ul>
<li><b>Bayesian Optimization</b></li>
<ul>
<li>GP-based BO</li>
<li>SMAC</li>
<li>TPE</li>
<li>LineBO</li>
<li>SafeOpt</li>
</ul>
</ul>
<ul>
<li><b>Multi-fidelity Optimization</b></li>
<ul>
<li>Hyperband</li>
<li>BOHB</li>
<li>MFES-HB</li>
</ul>
</ul>
<ul>
<li><b>Evolutionary Algorithms</b></li>
<ul>
<li>Surrogate-assisted EA</li>
<li>Regularized EA</li>
<li>Adaptive EA</li>
<li>Differential EA</li>
<li>NSGA-II</li>
</ul>
</ul>
<ul>
<li><b>Others</b></li>
<ul>
<li>Anneal</li>
<li>PSO</li>
<li>Random Search</li>
</ul>
</ul>
</td>
<td>
<ul>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Local Machine</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Cluster Servers</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Hybrid mode</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/openbox_as_service/openbox_as_service.html">
Software as a Service</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
## Installation
### System Requirements
Installation Requirements:
+ Python >= 3.7 (Python 3.7 is recommended!)
Supported Systems:
+ Linux (Ubuntu, ...)
+ macOS
+ Windows
We **strongly** suggest you to create a Python environment via
[Anaconda](https://www.anaconda.com/products/individual#Downloads):
```bash
conda create -n openbox python=3.7
conda activate openbox
```
Then we recommend you to update your `pip`, `setuptools` and `wheel` as follows:
```bash
pip install --upgrade pip setuptools wheel
```
### Installation from PyPI
To install OpenBox from PyPI:
```bash
pip install openbox
```
For advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install "openbox[extra]"`.
### Manual Installation from Source
To install the newest OpenBox from the source code, please run the following commands:
```bash
git clone https://github.com/PKU-DAIR/open-box.git && cd open-box
pip install .
```
Also, for advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install ".[extra]"`.
For more details about installation instructions, please refer to the
[Installation Guide](https://open-box.readthedocs.io/en/latest/installation/installation_guide.html).
## Quick Start
A quick start example is given by:
```python
import numpy as np
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", -5, 10, default_value=0)
x2 = sp.Real("x2", 0, 15, default_value=0)
space.add_variables([x1, x2])
# Define Objective Function
def branin(config):
x1, x2 = config['x1'], config['x2']
y = (x2-5.1/(4*np.pi**2)*x1**2+5/np.pi*x1-6)**2+10*(1-1/(8*np.pi))*np.cos(x1)+10
return {'objectives': [y]}
# Run
if __name__ == '__main__':
opt = Optimizer(branin, space, max_runs=50, task_id='quick_start')
history = opt.run()
print(history)
```
The example with multi-objectives and constraints is as follows:
```python
import matplotlib.pyplot as plt
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", 0.1, 10.0)
x2 = sp.Real("x2", 0.0, 5.0)
space.add_variables([x1, x2])
# Define Objective Function
def CONSTR(config):
x1, x2 = config['x1'], config['x2']
y1, y2 = x1, (1.0 + x2) / x1
c1, c2 = 6.0 - 9.0 * x1 - x2, 1.0 - 9.0 * x1 + x2
return dict(objectives=[y1, y2], constraints=[c1, c2])
# Run
if __name__ == "__main__":
opt = Optimizer(CONSTR, space, num_objectives=2, num_constraints=2,
max_runs=50, ref_point=[10.0, 10.0], task_id='moc')
history = opt.run()
history.plot_pareto_front() # plot for 2 or 3 objectives
plt.show()
```
We also provide **HTML Visualization**. Enable it by setting additional options
`visualization`=`basic`/`advanced` and `auto_open_html=True`(optional) in `Optimizer`:
```python
opt = Optimizer(...,
visualization='advanced', # or 'basic'. For 'advanced', run 'pip install "openbox[extra]"' first
auto_open_html=True, # open the visualization page in your browser automatically
)
history = opt.run()
```
For more visualization details, please refer to
[HTML Visualization](https://open-box.readthedocs.io/en/latest/visualization/visualization.html).
**More Examples**:
+ [Single-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_problem_with_constraint.py)
+ [Multi-Objective](https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective.py)
+ [Multi-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective_with_constraint.py)
+ [Ask-and-tell Interface](https://github.com/PKU-DAIR/open-box/blob/master/examples/ask_and_tell_interface.py)
+ [Parallel Evaluation on Local](
https://github.com/PKU-DAIR/open-box/blob/master/examples/evaluate_async_parallel_optimization.py)
+ [Distributed Evaluation](https://github.com/PKU-DAIR/open-box/blob/master/examples/distributed_optimization.py)
+ [Tuning LightGBM](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_lightgbm.py)
+ [Tuning XGBoost](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_xgboost.py)
## **Enterprise Users**
<img src="docs/imgs/logo_tencent.png" width="35%" class="align-left" alt="Tencent Logo">
* [Tencent Inc.](https://www.tencent.com/en-us/)
<img src="docs/imgs/logo_alibaba.png" width="35%" class="align-left" alt="Alibaba Logo">
* [Alibaba Group](https://www.alibabagroup.com/en-US/)
<img src="docs/imgs/logo_kuaishou.png" width="35%" class="align-left" alt="Kuaishou Logo">
* [Kuaishou Technology](https://www.kuaishou.com/en)
## **Contributing**
OpenBox has a frequent release cycle. Please let us know if you encounter a bug by
[filling an issue](https://github.com/PKU-DAIR/open-box/issues/new/choose).
We appreciate all contributions. If you are planning to contribute any bug-fixes,
please create a [pull request](https://github.com/PKU-DAIR/open-box/pulls).
If you plan to contribute new features, new modules, etc. please first open an issue or reuse an existing issue,
and discuss the feature with us.
To learn more about making a contribution to OpenBox, please refer to our
[How-to contribution page](https://github.com/PKU-DAIR/open-box/blob/master/CONTRIBUTING.md).
We appreciate all contributions and thank all the contributors!
## **Feedback**
* [File an issue](https://github.com/PKU-DAIR/open-box/issues) on GitHub
* Email us via [*Yang Li*](https://thomas-young-2013.github.io/),
*shenyu@pku.edu.cn* or *jianghuaijun@pku.edu.cn*
* [Q&A] Join the QQ group: 227229622
<!-- start of related projects and publications (for docs) -->
## **Related Projects**
Targeting at openness and advancing AutoML ecosystems, we had also released few other open-source projects.
* [MindWare](https://github.com/PKU-DAIR/mindware): an open source system that provides end-to-end ML model training
and inference capabilities.
* [SGL](https://github.com/PKU-DAIR/SGL): a scalable graph learning toolkit for extremely large graph datasets.
* [HyperTune](https://github.com/PKU-DAIR/HyperTune): a large-scale multi-fidelity hyper-parameter tuning system.
## **Related Publications**
**OpenBox: A Generalized Black-box Optimization Service.**
Yang Li, Yu Shen, Wentao Zhang, Yuanwei Chen, Huaijun Jiang, Mingchao Liu, Jiawei Jiang, Jinyang Gao, Wentao Wu,
Zhi Yang, Ce Zhang, Bin Cui; KDD 2021, CCF-A.
https://arxiv.org/abs/2106.00421
**MFES-HB: Efficient Hyperband with Multi-Fidelity Quality Measurements.**
Yang Li, Yu Shen, Jiawei Jiang, Jinyang Gao, Ce Zhang, Bin Cui; AAAI 2021, CCF-A.
https://arxiv.org/abs/2012.03011
**Transfer Learning based Search Space Design for Hyperparameter Tuning.**
Yang Li, Yu Shen, Huaijun Jiang, Tianyi Bai, Wentao Zhang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02511
**TransBO: Hyperparameter Optimization via Two-Phase Transfer Learning.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Zhi Yang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02663
**PaSca: a Graph Neural Architecture Search System under the Scalable Paradigm.**
Wentao Zhang, Yu Shen, Zheyu Lin, Yang Li, Xiaosen Li, Wen Ouyang, Yangyu Tao, Zhi Yang, and Bin Cui;
WWW 2022, CCF-A, 🏆 Best Student Paper Award.
https://arxiv.org/abs/2203.00638
**Hyper-Tune: Towards Efficient Hyper-parameter Tuning at Scale.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Jixiang Li, Ji Liu, Ce Zhang, Bin Cui; VLDB 2022, CCF-A.
https://arxiv.org/abs/2201.06834
<!-- end of related projects and publications (for docs) -->
## **License**
The entire codebase is under [MIT license](LICENSE).
%package -n python3-openbox
Summary: Efficient and generalized blackbox optimization (BBO) system
Provides: python-openbox
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-openbox
[](
https://github.com/PKU-DAIR/open-box/blob/master/LICENSE)
[](
https://github.com/PKU-DAIR/open-box/issues?q=is%3Aissue+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/pulls?q=is%3Apr+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/releases)
[](https://github.com/PKU-DAIR/open-box/actions/workflows/test.yml)
[](
https://open-box.readthedocs.io/)
[OpenBox Documentation](https://open-box.readthedocs.io)
| [OpenBox中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
| [中文README](https://github.com/PKU-DAIR/open-box/blob/master/README_zh_CN.md)
## OpenBox: Generalized and Efficient Blackbox Optimization System
**OpenBox** is an efficient and generalized blackbox optimization (BBO) system, which supports the following
characteristics: 1) **BBO with multiple objectives and constraints**, 2) **BBO with transfer learning**, 3)
**BBO with distributed parallelization**, 4) **BBO with multi-fidelity acceleration** and 5) **BBO with early stops**.
OpenBox is designed and developed by the AutoML team from the [DAIR Lab](http://net.pku.edu.cn/~cuibin/) at Peking
University, and its goal is to make blackbox optimization easier to apply both in industry and academia, and help
facilitate data science.
## Software Artifacts
#### Standalone Python package.
Users can install the released package and use it with Python.
#### Distributed BBO service.
We adopt the "BBO as a service" paradigm and implement OpenBox as a managed general service for black-box optimization.
Users can access this service via REST API conveniently, and do not need to worry about other issues such as environment
setup, software maintenance, programming, and optimization of the execution. Moreover, we also provide a Web UI,
through which users can easily track and manage the tasks.
## Design Goal
The design of OpenBox follows the following principles:
+ **Ease of use**: Minimal user effort, and user-friendly visualization for tracking and managing BBO tasks.
+ **Consistent performance**: Host state-of-the-art optimization algorithms; Choose the proper algorithm automatically.
+ **Resource-aware management**: Give cost-model-based advice to users, e.g., minimal workers or time-budget.
+ **Scalability**: Scale to dimensions on the number of input variables, objectives, tasks, trials, and parallel
evaluations.
+ **High efficiency**: Effective use of parallel resources, system optimization with transfer-learning and
multi-fidelities, etc.
+ **Fault tolerance**, **extensibility**, and **data privacy protection**.
## Links
+ [Documentations](https://open-box.readthedocs.io/en/latest/) |
[中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
+ [Examples](https://github.com/PKU-DAIR/open-box/tree/master/examples)
+ [Pypi package](https://pypi.org/project/openbox/)
+ Conda package: [to appear soon]()
+ Blog post: [to appear soon]()
<!-- start of news (for docs) -->
## News
+ **OpenBox** based solutions achieved the **First Place** of
[ACM CIKM 2021 AnalyticCup](https://www.cikm2021.org/analyticup)
(Track - Automated Hyperparameter Optimization of Recommendation System).
+ **OpenBox** team won the **Top Prize (special prize)** in the open-source innovation competition at
[2021 CCF ChinaSoft](http://chinasoft.ccf.org.cn/papers/chinasoft.html) conference.
+ [**Pasca**](https://github.com/PKU-DAIR/SGL), which adopts Openbox to support neural architecture search
functionality, won the **Best Student Paper Award at WWW'22**.
<!-- end of news (for docs) -->
## OpenBox Capabilities in a Glance
<table>
<tbody>
<tr align="center" valign="bottom">
<td>
<b>Build-in Optimization Components</b>
</td>
<td>
<b>Optimization Algorithms</b>
</td>
<td>
<b>Optimization Services</b>
</td>
</tr>
<tr valign="top">
<td>
<ul><li><b>Surrogate Model</b></li>
<ul>
<li>Gaussian Process</li>
<li>TPE</li>
<li>Probabilistic Random Forest</li>
<li>LightGBM</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Function</b></li>
<ul>
<li>EI</li>
<li>PI</li>
<li>UCB</li>
<li>MES</li>
<li>EHVI</li>
<li>TS</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Optimizer</b></li>
<ul>
<li>Random Search</li>
<li>Local Search</li>
<li>Interleaved RS and LS</li>
<li>Differential Evolution</li>
<li>L-BFGS-B</li>
</ul>
</ul>
</td>
<td align="left" >
<ul>
<li><b>Bayesian Optimization</b></li>
<ul>
<li>GP-based BO</li>
<li>SMAC</li>
<li>TPE</li>
<li>LineBO</li>
<li>SafeOpt</li>
</ul>
</ul>
<ul>
<li><b>Multi-fidelity Optimization</b></li>
<ul>
<li>Hyperband</li>
<li>BOHB</li>
<li>MFES-HB</li>
</ul>
</ul>
<ul>
<li><b>Evolutionary Algorithms</b></li>
<ul>
<li>Surrogate-assisted EA</li>
<li>Regularized EA</li>
<li>Adaptive EA</li>
<li>Differential EA</li>
<li>NSGA-II</li>
</ul>
</ul>
<ul>
<li><b>Others</b></li>
<ul>
<li>Anneal</li>
<li>PSO</li>
<li>Random Search</li>
</ul>
</ul>
</td>
<td>
<ul>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Local Machine</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Cluster Servers</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Hybrid mode</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/openbox_as_service/openbox_as_service.html">
Software as a Service</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
## Installation
### System Requirements
Installation Requirements:
+ Python >= 3.7 (Python 3.7 is recommended!)
Supported Systems:
+ Linux (Ubuntu, ...)
+ macOS
+ Windows
We **strongly** suggest you to create a Python environment via
[Anaconda](https://www.anaconda.com/products/individual#Downloads):
```bash
conda create -n openbox python=3.7
conda activate openbox
```
Then we recommend you to update your `pip`, `setuptools` and `wheel` as follows:
```bash
pip install --upgrade pip setuptools wheel
```
### Installation from PyPI
To install OpenBox from PyPI:
```bash
pip install openbox
```
For advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install "openbox[extra]"`.
### Manual Installation from Source
To install the newest OpenBox from the source code, please run the following commands:
```bash
git clone https://github.com/PKU-DAIR/open-box.git && cd open-box
pip install .
```
Also, for advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install ".[extra]"`.
For more details about installation instructions, please refer to the
[Installation Guide](https://open-box.readthedocs.io/en/latest/installation/installation_guide.html).
## Quick Start
A quick start example is given by:
```python
import numpy as np
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", -5, 10, default_value=0)
x2 = sp.Real("x2", 0, 15, default_value=0)
space.add_variables([x1, x2])
# Define Objective Function
def branin(config):
x1, x2 = config['x1'], config['x2']
y = (x2-5.1/(4*np.pi**2)*x1**2+5/np.pi*x1-6)**2+10*(1-1/(8*np.pi))*np.cos(x1)+10
return {'objectives': [y]}
# Run
if __name__ == '__main__':
opt = Optimizer(branin, space, max_runs=50, task_id='quick_start')
history = opt.run()
print(history)
```
The example with multi-objectives and constraints is as follows:
```python
import matplotlib.pyplot as plt
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", 0.1, 10.0)
x2 = sp.Real("x2", 0.0, 5.0)
space.add_variables([x1, x2])
# Define Objective Function
def CONSTR(config):
x1, x2 = config['x1'], config['x2']
y1, y2 = x1, (1.0 + x2) / x1
c1, c2 = 6.0 - 9.0 * x1 - x2, 1.0 - 9.0 * x1 + x2
return dict(objectives=[y1, y2], constraints=[c1, c2])
# Run
if __name__ == "__main__":
opt = Optimizer(CONSTR, space, num_objectives=2, num_constraints=2,
max_runs=50, ref_point=[10.0, 10.0], task_id='moc')
history = opt.run()
history.plot_pareto_front() # plot for 2 or 3 objectives
plt.show()
```
We also provide **HTML Visualization**. Enable it by setting additional options
`visualization`=`basic`/`advanced` and `auto_open_html=True`(optional) in `Optimizer`:
```python
opt = Optimizer(...,
visualization='advanced', # or 'basic'. For 'advanced', run 'pip install "openbox[extra]"' first
auto_open_html=True, # open the visualization page in your browser automatically
)
history = opt.run()
```
For more visualization details, please refer to
[HTML Visualization](https://open-box.readthedocs.io/en/latest/visualization/visualization.html).
**More Examples**:
+ [Single-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_problem_with_constraint.py)
+ [Multi-Objective](https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective.py)
+ [Multi-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective_with_constraint.py)
+ [Ask-and-tell Interface](https://github.com/PKU-DAIR/open-box/blob/master/examples/ask_and_tell_interface.py)
+ [Parallel Evaluation on Local](
https://github.com/PKU-DAIR/open-box/blob/master/examples/evaluate_async_parallel_optimization.py)
+ [Distributed Evaluation](https://github.com/PKU-DAIR/open-box/blob/master/examples/distributed_optimization.py)
+ [Tuning LightGBM](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_lightgbm.py)
+ [Tuning XGBoost](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_xgboost.py)
## **Enterprise Users**
<img src="docs/imgs/logo_tencent.png" width="35%" class="align-left" alt="Tencent Logo">
* [Tencent Inc.](https://www.tencent.com/en-us/)
<img src="docs/imgs/logo_alibaba.png" width="35%" class="align-left" alt="Alibaba Logo">
* [Alibaba Group](https://www.alibabagroup.com/en-US/)
<img src="docs/imgs/logo_kuaishou.png" width="35%" class="align-left" alt="Kuaishou Logo">
* [Kuaishou Technology](https://www.kuaishou.com/en)
## **Contributing**
OpenBox has a frequent release cycle. Please let us know if you encounter a bug by
[filling an issue](https://github.com/PKU-DAIR/open-box/issues/new/choose).
We appreciate all contributions. If you are planning to contribute any bug-fixes,
please create a [pull request](https://github.com/PKU-DAIR/open-box/pulls).
If you plan to contribute new features, new modules, etc. please first open an issue or reuse an existing issue,
and discuss the feature with us.
To learn more about making a contribution to OpenBox, please refer to our
[How-to contribution page](https://github.com/PKU-DAIR/open-box/blob/master/CONTRIBUTING.md).
We appreciate all contributions and thank all the contributors!
## **Feedback**
* [File an issue](https://github.com/PKU-DAIR/open-box/issues) on GitHub
* Email us via [*Yang Li*](https://thomas-young-2013.github.io/),
*shenyu@pku.edu.cn* or *jianghuaijun@pku.edu.cn*
* [Q&A] Join the QQ group: 227229622
<!-- start of related projects and publications (for docs) -->
## **Related Projects**
Targeting at openness and advancing AutoML ecosystems, we had also released few other open-source projects.
* [MindWare](https://github.com/PKU-DAIR/mindware): an open source system that provides end-to-end ML model training
and inference capabilities.
* [SGL](https://github.com/PKU-DAIR/SGL): a scalable graph learning toolkit for extremely large graph datasets.
* [HyperTune](https://github.com/PKU-DAIR/HyperTune): a large-scale multi-fidelity hyper-parameter tuning system.
## **Related Publications**
**OpenBox: A Generalized Black-box Optimization Service.**
Yang Li, Yu Shen, Wentao Zhang, Yuanwei Chen, Huaijun Jiang, Mingchao Liu, Jiawei Jiang, Jinyang Gao, Wentao Wu,
Zhi Yang, Ce Zhang, Bin Cui; KDD 2021, CCF-A.
https://arxiv.org/abs/2106.00421
**MFES-HB: Efficient Hyperband with Multi-Fidelity Quality Measurements.**
Yang Li, Yu Shen, Jiawei Jiang, Jinyang Gao, Ce Zhang, Bin Cui; AAAI 2021, CCF-A.
https://arxiv.org/abs/2012.03011
**Transfer Learning based Search Space Design for Hyperparameter Tuning.**
Yang Li, Yu Shen, Huaijun Jiang, Tianyi Bai, Wentao Zhang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02511
**TransBO: Hyperparameter Optimization via Two-Phase Transfer Learning.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Zhi Yang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02663
**PaSca: a Graph Neural Architecture Search System under the Scalable Paradigm.**
Wentao Zhang, Yu Shen, Zheyu Lin, Yang Li, Xiaosen Li, Wen Ouyang, Yangyu Tao, Zhi Yang, and Bin Cui;
WWW 2022, CCF-A, 🏆 Best Student Paper Award.
https://arxiv.org/abs/2203.00638
**Hyper-Tune: Towards Efficient Hyper-parameter Tuning at Scale.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Jixiang Li, Ji Liu, Ce Zhang, Bin Cui; VLDB 2022, CCF-A.
https://arxiv.org/abs/2201.06834
<!-- end of related projects and publications (for docs) -->
## **License**
The entire codebase is under [MIT license](LICENSE).
%package help
Summary: Development documents and examples for openbox
Provides: python3-openbox-doc
%description help
[](
https://github.com/PKU-DAIR/open-box/blob/master/LICENSE)
[](
https://github.com/PKU-DAIR/open-box/issues?q=is%3Aissue+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/pulls?q=is%3Apr+is%3Aopen)
[](
https://github.com/PKU-DAIR/open-box/releases)
[](https://github.com/PKU-DAIR/open-box/actions/workflows/test.yml)
[](
https://open-box.readthedocs.io/)
[OpenBox Documentation](https://open-box.readthedocs.io)
| [OpenBox中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
| [中文README](https://github.com/PKU-DAIR/open-box/blob/master/README_zh_CN.md)
## OpenBox: Generalized and Efficient Blackbox Optimization System
**OpenBox** is an efficient and generalized blackbox optimization (BBO) system, which supports the following
characteristics: 1) **BBO with multiple objectives and constraints**, 2) **BBO with transfer learning**, 3)
**BBO with distributed parallelization**, 4) **BBO with multi-fidelity acceleration** and 5) **BBO with early stops**.
OpenBox is designed and developed by the AutoML team from the [DAIR Lab](http://net.pku.edu.cn/~cuibin/) at Peking
University, and its goal is to make blackbox optimization easier to apply both in industry and academia, and help
facilitate data science.
## Software Artifacts
#### Standalone Python package.
Users can install the released package and use it with Python.
#### Distributed BBO service.
We adopt the "BBO as a service" paradigm and implement OpenBox as a managed general service for black-box optimization.
Users can access this service via REST API conveniently, and do not need to worry about other issues such as environment
setup, software maintenance, programming, and optimization of the execution. Moreover, we also provide a Web UI,
through which users can easily track and manage the tasks.
## Design Goal
The design of OpenBox follows the following principles:
+ **Ease of use**: Minimal user effort, and user-friendly visualization for tracking and managing BBO tasks.
+ **Consistent performance**: Host state-of-the-art optimization algorithms; Choose the proper algorithm automatically.
+ **Resource-aware management**: Give cost-model-based advice to users, e.g., minimal workers or time-budget.
+ **Scalability**: Scale to dimensions on the number of input variables, objectives, tasks, trials, and parallel
evaluations.
+ **High efficiency**: Effective use of parallel resources, system optimization with transfer-learning and
multi-fidelities, etc.
+ **Fault tolerance**, **extensibility**, and **data privacy protection**.
## Links
+ [Documentations](https://open-box.readthedocs.io/en/latest/) |
[中文文档](https://open-box.readthedocs.io/zh_CN/latest/)
+ [Examples](https://github.com/PKU-DAIR/open-box/tree/master/examples)
+ [Pypi package](https://pypi.org/project/openbox/)
+ Conda package: [to appear soon]()
+ Blog post: [to appear soon]()
<!-- start of news (for docs) -->
## News
+ **OpenBox** based solutions achieved the **First Place** of
[ACM CIKM 2021 AnalyticCup](https://www.cikm2021.org/analyticup)
(Track - Automated Hyperparameter Optimization of Recommendation System).
+ **OpenBox** team won the **Top Prize (special prize)** in the open-source innovation competition at
[2021 CCF ChinaSoft](http://chinasoft.ccf.org.cn/papers/chinasoft.html) conference.
+ [**Pasca**](https://github.com/PKU-DAIR/SGL), which adopts Openbox to support neural architecture search
functionality, won the **Best Student Paper Award at WWW'22**.
<!-- end of news (for docs) -->
## OpenBox Capabilities in a Glance
<table>
<tbody>
<tr align="center" valign="bottom">
<td>
<b>Build-in Optimization Components</b>
</td>
<td>
<b>Optimization Algorithms</b>
</td>
<td>
<b>Optimization Services</b>
</td>
</tr>
<tr valign="top">
<td>
<ul><li><b>Surrogate Model</b></li>
<ul>
<li>Gaussian Process</li>
<li>TPE</li>
<li>Probabilistic Random Forest</li>
<li>LightGBM</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Function</b></li>
<ul>
<li>EI</li>
<li>PI</li>
<li>UCB</li>
<li>MES</li>
<li>EHVI</li>
<li>TS</li>
</ul>
</ul>
<ul>
<li><b>Acquisition Optimizer</b></li>
<ul>
<li>Random Search</li>
<li>Local Search</li>
<li>Interleaved RS and LS</li>
<li>Differential Evolution</li>
<li>L-BFGS-B</li>
</ul>
</ul>
</td>
<td align="left" >
<ul>
<li><b>Bayesian Optimization</b></li>
<ul>
<li>GP-based BO</li>
<li>SMAC</li>
<li>TPE</li>
<li>LineBO</li>
<li>SafeOpt</li>
</ul>
</ul>
<ul>
<li><b>Multi-fidelity Optimization</b></li>
<ul>
<li>Hyperband</li>
<li>BOHB</li>
<li>MFES-HB</li>
</ul>
</ul>
<ul>
<li><b>Evolutionary Algorithms</b></li>
<ul>
<li>Surrogate-assisted EA</li>
<li>Regularized EA</li>
<li>Adaptive EA</li>
<li>Differential EA</li>
<li>NSGA-II</li>
</ul>
</ul>
<ul>
<li><b>Others</b></li>
<ul>
<li>Anneal</li>
<li>PSO</li>
<li>Random Search</li>
</ul>
</ul>
</td>
<td>
<ul>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Local Machine</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Cluster Servers</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/advanced_usage/parallel_evaluation.html">
Hybrid mode</a></li>
<li><a href="https://open-box.readthedocs.io/en/latest/openbox_as_service/openbox_as_service.html">
Software as a Service</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
## Installation
### System Requirements
Installation Requirements:
+ Python >= 3.7 (Python 3.7 is recommended!)
Supported Systems:
+ Linux (Ubuntu, ...)
+ macOS
+ Windows
We **strongly** suggest you to create a Python environment via
[Anaconda](https://www.anaconda.com/products/individual#Downloads):
```bash
conda create -n openbox python=3.7
conda activate openbox
```
Then we recommend you to update your `pip`, `setuptools` and `wheel` as follows:
```bash
pip install --upgrade pip setuptools wheel
```
### Installation from PyPI
To install OpenBox from PyPI:
```bash
pip install openbox
```
For advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install "openbox[extra]"`.
### Manual Installation from Source
To install the newest OpenBox from the source code, please run the following commands:
```bash
git clone https://github.com/PKU-DAIR/open-box.git && cd open-box
pip install .
```
Also, for advanced features, [install SWIG](https://open-box.readthedocs.io/en/latest/installation/install_swig.html)
first and then run `pip install ".[extra]"`.
For more details about installation instructions, please refer to the
[Installation Guide](https://open-box.readthedocs.io/en/latest/installation/installation_guide.html).
## Quick Start
A quick start example is given by:
```python
import numpy as np
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", -5, 10, default_value=0)
x2 = sp.Real("x2", 0, 15, default_value=0)
space.add_variables([x1, x2])
# Define Objective Function
def branin(config):
x1, x2 = config['x1'], config['x2']
y = (x2-5.1/(4*np.pi**2)*x1**2+5/np.pi*x1-6)**2+10*(1-1/(8*np.pi))*np.cos(x1)+10
return {'objectives': [y]}
# Run
if __name__ == '__main__':
opt = Optimizer(branin, space, max_runs=50, task_id='quick_start')
history = opt.run()
print(history)
```
The example with multi-objectives and constraints is as follows:
```python
import matplotlib.pyplot as plt
from openbox import Optimizer, space as sp
# Define Search Space
space = sp.Space()
x1 = sp.Real("x1", 0.1, 10.0)
x2 = sp.Real("x2", 0.0, 5.0)
space.add_variables([x1, x2])
# Define Objective Function
def CONSTR(config):
x1, x2 = config['x1'], config['x2']
y1, y2 = x1, (1.0 + x2) / x1
c1, c2 = 6.0 - 9.0 * x1 - x2, 1.0 - 9.0 * x1 + x2
return dict(objectives=[y1, y2], constraints=[c1, c2])
# Run
if __name__ == "__main__":
opt = Optimizer(CONSTR, space, num_objectives=2, num_constraints=2,
max_runs=50, ref_point=[10.0, 10.0], task_id='moc')
history = opt.run()
history.plot_pareto_front() # plot for 2 or 3 objectives
plt.show()
```
We also provide **HTML Visualization**. Enable it by setting additional options
`visualization`=`basic`/`advanced` and `auto_open_html=True`(optional) in `Optimizer`:
```python
opt = Optimizer(...,
visualization='advanced', # or 'basic'. For 'advanced', run 'pip install "openbox[extra]"' first
auto_open_html=True, # open the visualization page in your browser automatically
)
history = opt.run()
```
For more visualization details, please refer to
[HTML Visualization](https://open-box.readthedocs.io/en/latest/visualization/visualization.html).
**More Examples**:
+ [Single-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_problem_with_constraint.py)
+ [Multi-Objective](https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective.py)
+ [Multi-Objective with Constraints](
https://github.com/PKU-DAIR/open-box/blob/master/examples/optimize_multi_objective_with_constraint.py)
+ [Ask-and-tell Interface](https://github.com/PKU-DAIR/open-box/blob/master/examples/ask_and_tell_interface.py)
+ [Parallel Evaluation on Local](
https://github.com/PKU-DAIR/open-box/blob/master/examples/evaluate_async_parallel_optimization.py)
+ [Distributed Evaluation](https://github.com/PKU-DAIR/open-box/blob/master/examples/distributed_optimization.py)
+ [Tuning LightGBM](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_lightgbm.py)
+ [Tuning XGBoost](https://github.com/PKU-DAIR/open-box/blob/master/examples/tuning_xgboost.py)
## **Enterprise Users**
<img src="docs/imgs/logo_tencent.png" width="35%" class="align-left" alt="Tencent Logo">
* [Tencent Inc.](https://www.tencent.com/en-us/)
<img src="docs/imgs/logo_alibaba.png" width="35%" class="align-left" alt="Alibaba Logo">
* [Alibaba Group](https://www.alibabagroup.com/en-US/)
<img src="docs/imgs/logo_kuaishou.png" width="35%" class="align-left" alt="Kuaishou Logo">
* [Kuaishou Technology](https://www.kuaishou.com/en)
## **Contributing**
OpenBox has a frequent release cycle. Please let us know if you encounter a bug by
[filling an issue](https://github.com/PKU-DAIR/open-box/issues/new/choose).
We appreciate all contributions. If you are planning to contribute any bug-fixes,
please create a [pull request](https://github.com/PKU-DAIR/open-box/pulls).
If you plan to contribute new features, new modules, etc. please first open an issue or reuse an existing issue,
and discuss the feature with us.
To learn more about making a contribution to OpenBox, please refer to our
[How-to contribution page](https://github.com/PKU-DAIR/open-box/blob/master/CONTRIBUTING.md).
We appreciate all contributions and thank all the contributors!
## **Feedback**
* [File an issue](https://github.com/PKU-DAIR/open-box/issues) on GitHub
* Email us via [*Yang Li*](https://thomas-young-2013.github.io/),
*shenyu@pku.edu.cn* or *jianghuaijun@pku.edu.cn*
* [Q&A] Join the QQ group: 227229622
<!-- start of related projects and publications (for docs) -->
## **Related Projects**
Targeting at openness and advancing AutoML ecosystems, we had also released few other open-source projects.
* [MindWare](https://github.com/PKU-DAIR/mindware): an open source system that provides end-to-end ML model training
and inference capabilities.
* [SGL](https://github.com/PKU-DAIR/SGL): a scalable graph learning toolkit for extremely large graph datasets.
* [HyperTune](https://github.com/PKU-DAIR/HyperTune): a large-scale multi-fidelity hyper-parameter tuning system.
## **Related Publications**
**OpenBox: A Generalized Black-box Optimization Service.**
Yang Li, Yu Shen, Wentao Zhang, Yuanwei Chen, Huaijun Jiang, Mingchao Liu, Jiawei Jiang, Jinyang Gao, Wentao Wu,
Zhi Yang, Ce Zhang, Bin Cui; KDD 2021, CCF-A.
https://arxiv.org/abs/2106.00421
**MFES-HB: Efficient Hyperband with Multi-Fidelity Quality Measurements.**
Yang Li, Yu Shen, Jiawei Jiang, Jinyang Gao, Ce Zhang, Bin Cui; AAAI 2021, CCF-A.
https://arxiv.org/abs/2012.03011
**Transfer Learning based Search Space Design for Hyperparameter Tuning.**
Yang Li, Yu Shen, Huaijun Jiang, Tianyi Bai, Wentao Zhang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02511
**TransBO: Hyperparameter Optimization via Two-Phase Transfer Learning.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Zhi Yang, Ce Zhang, Bin Cui; KDD 2022, CCF-A.
https://arxiv.org/abs/2206.02663
**PaSca: a Graph Neural Architecture Search System under the Scalable Paradigm.**
Wentao Zhang, Yu Shen, Zheyu Lin, Yang Li, Xiaosen Li, Wen Ouyang, Yangyu Tao, Zhi Yang, and Bin Cui;
WWW 2022, CCF-A, 🏆 Best Student Paper Award.
https://arxiv.org/abs/2203.00638
**Hyper-Tune: Towards Efficient Hyper-parameter Tuning at Scale.**
Yang Li, Yu Shen, Huaijun Jiang, Wentao Zhang, Jixiang Li, Ji Liu, Ce Zhang, Bin Cui; VLDB 2022, CCF-A.
https://arxiv.org/abs/2201.06834
<!-- end of related projects and publications (for docs) -->
## **License**
The entire codebase is under [MIT license](LICENSE).
%prep
%autosetup -n openbox-0.8.1
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-openbox -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.8.1-1
- Package Spec generated
|