没有项目描述
dragonfly-opt的Python项目详细描述
蜻蜓是一个用于可伸缩贝叶斯优化的开源python库。
贝叶斯优化用于优化黑盒函数,其评估为 通常很贵。除了普通的优化技术,蜻蜓还提供了一系列工具来 扩大贝叶斯优化到昂贵的大规模问题。 这些特性/功能特别适合 高维优化(对大量变量进行优化) 同步或异步设置中的并行计算(执行多个 并行评估,多保真度优化(使用廉价近似) 加速优化过程)和多目标优化(优化 同时执行多个功能)。
蜻蜓与python2(>;=2.7)和python3(>;=3.5)兼容,并经过测试 在Linux、MacOS和Windows平台上。 有关文档、安装和入门指南,请参阅 readthedocs page。有关详细信息,请参见 我们的paper。
安装
见 here 有关安装蜻蜓及其依赖项的详细说明。
快速安装:
如果你以前做过这种事情,你应该能够安装
蜻蜓经pip
。
$ sudo apt-get install python-dev python3-dev gfortran # On Ubuntu/Debian
$ pip install numpy
$ pip install dragonfly-opt -v
测试安装: 您可以在python中导入蜻蜓来测试它是否安装正确。 如果已通过源安装,请确保移动到其他目录 以避免命名冲突。
$ python >>> from dragonfly import minimise_function >>> # The first argument below is the function, the second is the domain, and the third is the budget. >>> min_val, min_pt, history= minimise_function(lambda x: x ** 4 - x**2 + 0.1 * x, [[-10, 10]], 10); ... >>> min_val, min_pt (-0.32122746026750953, array([-0.7129672]))
由于算法的随机性,上述min_val
,min_pt
的值可能是
不一样。如果你运行更长时间(例如
min_val, min_pt, history = minimise_function(lambda x: x ** 4 - x**2 + 0.1 * x, [[-10, 10]], 100)
,
你应该得到更一致的最小值。
如果安装失败或出现警告消息,请参阅详细说明 here。
快速启动
蜻蜓可以
通过调用
^{maximise_function
函数导入到python代码中。
为了帮助开始,我们在
^{
命令行: 下面是命令行中的一个使用示例。
$ cd examples
$ dragonfly-script.py --config synthetic/branin/config.json --options options_files/options_example.txt
在python代码中:
蜻蜓的主要api定义在
^{
fromdragonflyimportminimise_function,maximise_functionfunc=lambdax:x**4-x**2+0.1*xdomain=[[-10,10]]max_capital=100min_val,min_pt,history=minimise_function(func,domain,max_capital)print(min_val,min_pt)max_val,max_pt,history=maximise_function(lambdax:-func(x),domain,max_capital)print(max_val,max_pt)
这里,^ {CD11>}是要被最大化的函数,
domain
是要优化func
的域,
而max_capital
是可用于优化的资本。
可以通过json文件或代码指定域。
见
here,
here,
here,
here,
here,
here,
here,
here,
here,
here,
和
here
更详细的例子。
对于使用案例的综合列表,包括多目标优化, 多保真度优化、神经架构搜索和其他优化 方法(除了贝叶斯优化),请参阅我们的“阅读文档”页 (command line, Python)。
贡献者
柯特瓦桑坎大萨米:github,
webpage
卡伦·拉朱·维斯亚拉朱:github,
linkedin
威利·内斯旺格:github,
webpage
比斯瓦吉特帕里亚:github,
webpage
克里斯·柯林斯:github,
webpage
确认
这套方法的研究和开发由 DOE GRANT DES0011114、NSF GRANT IIS1563887、DARPA D3M计划和AFRL。
引文
如果你在工作中使用了本规范的任何部分,请引用 this manuscript。
@article{kandasamy2019tuning,
title={{Tuning Hyperparameters without Grad Students: Scalable and Robust Bayesian
Optimisation with Dragonfly}},
author={Kandasamy, Kirthevasan and Vysyaraju, Karun Raju and Neiswanger,
Willie and Paria, Biswajit and Collins, Christopher R. and Schneider, Jeff and
Poczos, Barnabas and Xing, Eric P},
journal={arXiv preprint arXiv:1903.06694},
year={2019}
}
许可证
这个软件是在麻省理工学院的许可下发布的。详情请参阅 LICENSE.txt。
如有疑问,请发电子邮件至kandasamy@cs.cmu.edu。
“版权所有2018-2019 Kirthevasan Kandasamy”