Package: openbox
OpenBox Documentation|OpenBox中文文档|中文READMEOpenBox: Generalized and Efficient Blackbox Optimization SystemOpenBoxis 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 accelerationand 5)BBO with early stops.
OpenBox is designed and developed by the AutoML team from theDAIR Labat Peking
University, and its goal is to make blackbox optimization easier to apply both in industry and academia, and help
facilitate data science.Software ArtifactsStandalone 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 GoalThe 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, anddata privacy protection.LinksDocumentations|中文文档ExamplesPypi packageConda package:to appear soonBlog post:to appear soonNewsOpenBoxbased solutions achieved theFirst PlaceofACM CIKM 2021 AnalyticCup(Track - Automated Hyperparameter Optimization of Recommendation System).OpenBoxteam won theTop Prize (special prize)in the open-source innovation competition at2021 CCF ChinaSoftconference.Pasca, which adopts Openbox to support neural architecture search
functionality, won theBest Student Paper Award at WWW'22.OpenBox Capabilities in a GlanceBuild-in Optimization ComponentsOptimization AlgorithmsOptimization ServicesSurrogate ModelGaussian ProcessTPEProbabilistic Random ForestLightGBMAcquisition FunctionEIPIUCBMESEHVITSAcquisition OptimizerRandom SearchLocal SearchInterleaved RS and LSDifferential EvolutionL-BFGS-BBayesian OptimizationGP-based BOSMACTPELineBOSafeOptMulti-fidelity OptimizationHyperbandBOHBMFES-HBEvolutionary AlgorithmsSurrogate-assisted EARegularized EAAdaptive EADifferential EANSGA-IIOthersAnnealPSORandom SearchLocal MachineCluster ServersHybrid modeSoftware as a ServiceInstallationSystem RequirementsInstallation Requirements:Python >= 3.7 (Python 3.7 is recommended!)Supported Systems:Linux (Ubuntu, ...)macOSWindowsWestronglysuggest you to create a Python environment viaAnaconda:condacreate-nopenboxpython=3.7
condaactivateopenboxThen we recommend you to update yourpip,setuptoolsandwheelas follows:pipinstall--upgradepipsetuptoolswheelInstallation from PyPITo install OpenBox from PyPI:pipinstallopenboxFor advanced features,install SWIGfirst and then runpip install "openbox[extra]".Manual Installation from SourceTo install the newest OpenBox from the source code, please run the following commands:gitclonehttps://github.com/PKU-DAIR/open-box.git&&cdopen-box
pipinstall.Also, for advanced features,install SWIGfirst and then runpip install ".[extra]".For more details about installation instructions, please refer to theInstallation Guide.Quick StartA quick start example is given by:importnumpyasnpfromopenboximportOptimizer,spaceassp# Define Search Spacespace=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 Functiondefbranin(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)+10return{'objectives':[y]}# Runif__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:importmatplotlib.pyplotaspltfromopenboximportOptimizer,spaceassp# Define Search Spacespace=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 FunctiondefCONSTR(config):x1,x2=config['x1'],config['x2']y1,y2=x1,(1.0+x2)/x1c1,c2=6.0-9.0*x1-x2,1.0-9.0*x1+x2returndict(objectives=[y1,y2],constraints=[c1,c2])# Runif__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 objectivesplt.show()We also provideHTML Visualization. Enable it by setting additional optionsvisualization=basic/advancedandauto_open_html=True(optional) inOptimizer:opt=Optimizer(...,visualization='advanced',# or 'basic'. For 'advanced', run 'pip install "openbox[extra]"' firstauto_open_html=True,# open the visualization page in your browser automatically)history=opt.run()For more visualization details, please refer toHTML Visualization.More Examples:Single-Objective with ConstraintsMulti-ObjectiveMulti-Objective with ConstraintsAsk-and-tell InterfaceParallel Evaluation on LocalDistributed EvaluationTuning LightGBMTuning XGBoostEnterprise UsersTencent Inc.Alibaba GroupKuaishou TechnologyContributingOpenBox has a frequent release cycle. Please let us know if you encounter a bug byfilling an issue.We appreciate all contributions. If you are planning to contribute any bug-fixes,
please create apull request.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 ourHow-to contribution page.We appreciate all contributions and thank all the contributors!FeedbackFile an issueon GitHubEmail us viaYang Li,shenyu@pku.edu.cnorjianghuaijun@pku.edu.cn[Q&A] Join the QQ group: 227229622Related ProjectsTargeting at openness and advancing AutoML ecosystems, we had also released few other open-source projects.MindWare: an open source system that provides end-to-end ML model training
and inference capabilities.SGL: a scalable graph learning toolkit for extremely large graph datasets.HyperTune: a large-scale multi-fidelity hyper-parameter tuning system.Related PublicationsOpenBox: 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.00421MFES-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.03011Transfer 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.02511TransBO: 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.02663PaSca: 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.00638Hyper-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.06834LicenseThe entire codebase is underMIT license.