不和谐 | 邮件列表 | 叽叽喳喳 |
---|---|---|
谷歌网上论坛 |
网站 | 来源 | 文档 | 纸 |
---|---|---|---|
pyribs.org | GitHub | docs.pyribs.org | Pyribs.org/paper |
皮伊 | 康达 | 持续集成/持续交付 | 文档状态 |
---|---|---|---|
用于质量多样性 (QD) 优化的基本Python 库。 Pyribs 实现了用于 QD 优化的高度模块化的行为空间快速照明 (RIBS)框架。 Pyribs 也是协方差矩阵适应 MAP-Elites (CMA-ME)、通过梯度树状结构的协方差矩阵适应 MAP-Elites (CMA-MEGA)、协方差矩阵适应 MAP-Annaling (CMA-MAE) 和可扩展变体的官方实现CMA-MAE 的。
加入 Pyribs 公告邮件列表,以获取有关项目状态和新版本的不频繁更新(每月少于 1 次)。
需要帮助吗?想知道 Pyribs 是否适合您的项目?有一个不完全是错误也不完全是功能请求的问题吗?
加入不和谐社区!
质量多样性 (QD) 优化是优化的一个子领域,其中生成的解决方案覆盖测量空间中的每个点,同时最大化(或最小化)单个目标。 MAP-Elites QD 算法系列中的 QD 算法生成热图(档案)作为输出,其中每个单元格包含测量空间中某个区域的最佳发现代表。
在 QD 文献中,测量函数输出也被称为“行为特征”、“行为描述符”或“特征描述符”。
近年来,QD 算法得到了大量的发展。为了代表这些和未来的算法,我们开发了高度模块化的 RIBS 框架。 RIBS 将 QD 算法分为三个部分:
通过互换这些组件,用户可以编写大量的 QD 算法。
Pyribs 是 RIBS 框架的实现,旨在支持广泛的用户,从进入该领域的初学者到寻求开发新算法的经验丰富的研究人员。 Pyribs 通过体现三个原则来实现这些目标:
与其他 QD 库相比,pyribs 是“简单的”。例如,与 pycma 一样,pyribs 只专注于优化固定维度的连续域。关注这一常见问题使我们能够优化库的性能和易用性。如果您需要处理其他用例,请参阅下面的其他 QD 库列表。
遵循RIBS框架(如下图所示),pyribs中的标准算法运行如下:
ask()
方法。调度程序通过调用发射器的ask()
方法向每个发射器请求解决方案。tell()
方法。调度程序将解决方案添加到存档中并接收反馈。调度程序将此反馈连同评估的解决方案一起传递给每个发射器的tell()
方法,然后每个发射器更新其内部状态。 Pyribs 支持 Python 3.8 及以上版本。绝大多数用户可以通过运行以下命令来安装pyribs:
# If you are on Mac, you may need to use quotations, e.g., pip install "ribs[visualize]"
pip install ribs[visualize]
上面的命令包含visualize
额外内容。如果您不使用pyribs可视化工具,您可以使用以下命令安装pyribs的基本版本:
pip install ribs
有关更具体的安装命令(例如,从 Conda 安装或从源安装),请访问我们网站上的安装选择器。
要测试您的安装,请导入 Pyribs 并使用以下命令打印版本:
python -c " import ribs; print(ribs.__version__) "
您应该在输出中看到版本号。
这里我们展示了 CMA-ME 在 Pyribs 中的应用示例。为了初始化算法,我们首先创建:
初始化组件后,我们优化(pyribs 最大化)负 10-D 球体函数 1000 次迭代。 pycma 的用户会熟悉ask-tell 界面(pyribs 采用的)。首先,用户必须向调度程序ask
新的候选解决方案。在评估解决方案后,他们tell
调度程序每个候选解决方案的目标和措施。然后,该算法会填充存档并决定下一步在哪里采样解决方案。我们的玩具示例使用搜索空间的前两个参数作为度量。
import numpy as np
from ribs . archives import GridArchive
from ribs . emitters import EvolutionStrategyEmitter
from ribs . schedulers import Scheduler
archive = GridArchive (
solution_dim = 10 ,
dims = [ 20 , 20 ],
ranges = [( - 1 , 1 ), ( - 1 , 1 )],
)
emitters = [
EvolutionStrategyEmitter (
archive ,
x0 = [ 0.0 ] * 10 ,
sigma0 = 0.1 ,
) for _ in range ( 3 )
]
scheduler = Scheduler ( archive , emitters )
for itr in range ( 1000 ):
solutions = scheduler . ask ()
# Optimize the 10D negative Sphere function.
objective_batch = - np . sum ( np . square ( solutions ), axis = 1 )
# Measures: first 2 coordinates of each 10D solution.
measures_batch = solutions [:, : 2 ]
scheduler . tell ( objective_batch , measures_batch )
为了使用 Matplotlib 可视化该存档,我们使用ribs.visualize
中的grid_archive_heatmap
函数。
import matplotlib . pyplot as plt
from ribs . visualize import grid_archive_heatmap
grid_archive_heatmap ( archive )
plt . show ()
该文档可在此处在线获取。我们建议新用户从教程开始。
Pyribs 首次发布两年后,我们发布了一篇论文,详细介绍了 RIBS 框架以及 Pyribs 背后的设计决策。有关本文的更多信息,请参阅此处。如果您在研究中使用 Pyribs,请考虑按如下方式引用本文。另请考虑引用您使用的任何算法,如下所示。
@inproceedings{10.1145/3583131.3590374,
author = {Tjanaka, Bryon and Fontaine, Matthew C and Lee, David H and Zhang, Yulun and Balam, Nivedit Reddy and Dennler, Nathaniel and Garlanka, Sujay S and Klapsis, Nikitas Dimitri and Nikolaidis, Stefanos},
title = {Pyribs: A Bare-Bones Python Library for Quality Diversity Optimization},
year = {2023},
isbn = {9798400701191},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3583131.3590374},
doi = {10.1145/3583131.3590374},
abstract = {Recent years have seen a rise in the popularity of quality diversity (QD) optimization, a branch of optimization that seeks to find a collection of diverse, high-performing solutions to a given problem. To grow further, we believe the QD community faces two challenges: developing a framework to represent the field's growing array of algorithms, and implementing that framework in software that supports a range of researchers and practitioners. To address these challenges, we have developed pyribs, a library built on a highly modular conceptual QD framework. By replacing components in the conceptual framework, and hence in pyribs, users can compose algorithms from across the QD literature; equally important, they can identify unexplored algorithm variations. Furthermore, pyribs makes this framework simple, flexible, and accessible, with a user-friendly API supported by extensive documentation and tutorials. This paper overviews the creation of pyribs, focusing on the conceptual framework that it implements and the design principles that have guided the library's development. Pyribs is available at https://pyribs.org},
booktitle = {Proceedings of the Genetic and Evolutionary Computation Conference},
pages = {220–229},
numpages = {10},
keywords = {framework, quality diversity, software library},
location = {Lisbon, Portugal},
series = {GECCO '23}
}
Pyribs 由南加州大学的 ICAROS 实验室开发和维护。有关为存储库做出贡献的信息,请参阅贡献。
我们感谢 Amy K. Hoover 和 Julian Togelius 对 CMA-ME 算法的贡献。
Pyribs 用户包括:
有关使用 Pyribs 的出版物列表,请参阅我们的 Google Scholar 条目。
请参阅 GitHub 依赖关系图,了解依赖于 Pyribs 的公共 GitHub 存储库。
如果您使用以下算法,请考虑引用其相关论文:
@inproceedings{10.1145/3377930.3390232,
author = {Fontaine, Matthew C. and Togelius, Julian and Nikolaidis, Stefanos and Hoover, Amy K.},
title = {Covariance Matrix Adaptation for the Rapid Illumination of Behavior Space},
year = {2020},
isbn = {9781450371285},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3377930.3390232},
doi = {10.1145/3377930.3390232},
booktitle = {Proceedings of the 2020 Genetic and Evolutionary Computation Conference},
pages = {94–102},
numpages = {9},
location = {Canc'{u}n, Mexico},
series = {GECCO '20}
}
@inproceedings{NEURIPS2021_532923f1,
author = {Fontaine, Matthew and Nikolaidis, Stefanos},
booktitle = {Advances in Neural Information Processing Systems},
editor = {M. Ranzato and A. Beygelzimer and Y. Dauphin and P.S. Liang and J. Wortman Vaughan},
pages = {10040--10052},
publisher = {Curran Associates, Inc.},
title = {Differentiable Quality Diversity},
url = {https://proceedings.neurips.cc/paper/2021/file/532923f11ac97d3e7cb0130315b067dc-Paper.pdf},
volume = {34},
year = {2021}
}
@misc{cmamae,
doi = {10.48550/ARXIV.2205.10752},
url = {https://arxiv.org/abs/2205.10752},
author = {Fontaine, Matthew C. and Nikolaidis, Stefanos},
keywords = {Machine Learning (cs.LG), Artificial Intelligence (cs.AI), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Covariance Matrix Adaptation MAP-Annealing},
publisher = {arXiv},
year = {2022},
copyright = {arXiv.org perpetual, non-exclusive license}
}
@ARTICLE{10243102,
author={Tjanaka, Bryon and Fontaine, Matthew C. and Lee, David H. and Kalkar, Aniruddha and Nikolaidis, Stefanos},
journal={IEEE Robotics and Automation Letters},
title={Training Diverse High-Dimensional Controllers by Scaling Covariance Matrix Adaptation MAP-Annealing},
year={2023},
volume={8},
number={10},
pages={6771-6778},
keywords={Covariance matrices;Training;Neural networks;Legged locomotion;Reinforcement learning;Evolutionary robotics;Evolutionary robotics;reinforcement learning},
doi={10.1109/LRA.2023.3313012}
}
Pyribs 是根据 MIT 许可证发布的。
Pyribs 包最初是使用 Cookiecutter 和 audreyr/cookiecutter-pypackage 项目模板创建的。