不和諧 | 郵件列表 | 嘰嘰喳喳 |
---|---|---|
谷歌網路論壇 |
網站 | 來源 | 文件 | 紙 |
---|---|---|---|
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 專案範本建立的。