QDax是一个通过硬件加速器和大规模并行化来加速质量多样性(QD)和神经进化算法的工具。QD算法通常需要在大型CPU集群上运行数天/数周。使用QDax,QD算法现在可以在几分钟内完成!⏩ ⏩ 🕛
QDax被开发为一个研究框架:它灵活易扩展,可用于任何问题设置。从这里开始简单示例,几分钟内运行QD算法!
QDax可在PyPI上获取,使用以下命令安装:
pip install qdax
或者,可以直接从源代码安装QDax的最新提交:
pip install git+https://github.com/adaptive-intelligent-robotics/QDax.git@main
通过pip安装QDax默认安装仅CPU版本的JAX。要在NVidia GPU上使用QDax,您必须先安装CUDA、CuDNN和支持GPU的JAX。
然而,我们还提供并推荐使用Docker或conda环境来使用该仓库,默认提供GPU支持。详细步骤可在文档中找到。
要全面了解QDax的工作原理,我们建议从教程风格的Colab笔记本开始。这是一个使用MAP-Elites算法在选定的Brax环境(默认为Walker)中进化控制器群体的示例。
以下是主要API使用的摘要:
import jax import functools from qdax.core.map_elites import MAPElites from qdax.core.containers.mapelites_repertoire import compute_euclidean_centroids from qdax.tasks.arm import arm_scoring_function from qdax.core.emitters.mutation_operators import isoline_variation from qdax.core.emitters.standard_emitters import MixingEmitter from qdax.utils.metrics import default_qd_metrics seed = 42 num_param_dimensions = 100 # 机械臂自由度数量 init_batch_size = 100 batch_size = 1024 num_iterations = 50 grid_shape = (100, 100) min_param = 0.0 max_param = 1.0 min_bd = 0.0 max_bd = 1.0 # 初始化随机密钥 random_key = jax.random.PRNGKey(seed) # 初始化控制器群体 random_key, subkey = jax.random.split(random_key) init_variables = jax.random.uniform( subkey, shape=(init_batch_size, num_param_dimensions), minval=min_param, maxval=max_param, ) # 定义发射器 variation_fn = functools.partial( isoline_variation, iso_sigma=0.05, line_sigma=0.1, minval=min_param, maxval=max_param, ) mixing_emitter = MixingEmitter( mutation_fn=lambda x, y: (x, y), variation_fn=variation_fn, variation_percentage=1.0, batch_size=batch_size, ) # 定义度量函数 metrics_fn = functools.partial( default_qd_metrics, qd_offset=0.0, ) # 实例化MAP-Elites map_elites = MAPElites( scoring_function=arm_scoring_function, emitter=mixing_emitter, metrics_function=metrics_fn, ) # 计算质心 centroids = compute_euclidean_centroids( grid_shape=grid_shape, minval=min_bd, maxval=max_bd, ) # 初始化库和发射器状态 repertoire, emitter_state, random_key = map_elites.init(init_variables, centroids, random_key) # 运行MAP-Elites循环 for i in range(num_iterations): (repertoire, emitter_state, metrics, random_key,) = map_elites.update( repertoire, emitter_state, random_key, ) # 获取库内容 repertoire.genotypes, repertoire.fitnesses, repertoire.descriptors
QDax目前支持以下算法:
| 算法 | 示例 |
|---|---|
| MAP-Elites | |
| CVT MAP-Elites | |
| 策略梯度辅助MAP-Elites (PGA-ME) | |
| QDPG | |
| CMA-ME | |
| OMG-MEGA | |
| CMA-MEGA | |
| 多目标MAP-Elites (MOME) | |
| MAP-Elites进化策略 (MEES) | |
| MAP-Elites PBT (ME-PBT) | |
| MAP-Elites低扩散 (ME-LS) |
QDax库还提供了一些有用的基准算法实现:
| 算法 | 示例 |
|---|---|
| DIAYN | |
| DADS | |
| SMERL | |
| NSGA2 | |
| SPEA2 | |
| 基于种群的训练 (PBT) |
QDax库还为多个标准质量多样性任务提供了众多实现。
所有这些实现及其描述都在任务目录中提供。
欢迎提出问题和贡献。更多详细信息请参阅文档中的贡献指南。
如果您在研究中使用了QDax并想在您的工作中引用它,请使用:
@misc{chalumeau2023qdax,
title={QDax: A Library for Quality-Diversity and Population-based Algorithms with Hardware Acceleration},
author={Felix Chalumeau and Bryan Lim and Raphael Boige and Maxime Allard and Luca Grillotti and Manon Flageat and Valentin Macé and Arthur Flajolet and Thomas Pierrot and Antoine Cully},
year={2023},
eprint={2308.03665},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
QDax由自适应智能机器人实验室(AIRL)和InstaDeep开发和维护。
<div align="center"> <img align="center" src="https://yellow-cdn.veclightyear.com/0a4dffa0/9b36980d-16e2-4b33-9212-f4f765ab1fe7.png" alt="AIRL_Logo" width="220"/> <img align="center" src="https://yellow-cdn.veclightyear.com/0a4dffa0/4a1c045f-6fa0-4009-a074-7d29c4001a9e.png" alt="InstaDeep_Logo" width="220"/> </div> <div align="center"> <a href="https://github.com/limbryan" title="Bryan Lim"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/5473b0c5-97e7-417a-96c3-2b6c5513b1cd.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/maxiallard" title="Maxime Allard"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/ad48dfd3-4930-49b0-85ff-9abfac0efcaa.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/Lookatator" title="Luca Grilloti"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/017aa869-1392-48df-af9d-b58dcd995faf.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/manon-but-yes" title="Manon Flageat"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/f505e8dc-9c52-48e3-aadb-a3fedf184e3c.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/Aneoshun" title="Antoine Cully"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/2dc55377-b282-42f9-b27a-11a04a7fabe4.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/felixchalumeau" title="Felix Chalumeau"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/1ca146e0-b0a0-448c-9414-247772f97779.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/ranzenTom" title="Thomas Pierrot"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/69578cef-6968-4c9f-bd4b-81cad4908080.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/Egiob" title="Raphael Boige"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/f1769350-63ee-417a-90cc-06610250fb78.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/valentinmace" title="Valentin Mace"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/8b59c88a-c5e3-4c4e-83ec-5329da374cf6.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/GRichard513" title="Guillaume Richard"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/9093cd78-2a49-455c-b482-2792c4c2d429.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/flajolet" title="Arthur Flajolet"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/496d037a-c48f-4eff-9bfa-ea0d37205edc.png" height="auto" width="50" style="border-radius:50%"></a> <a href="https://github.com/remidebette" title="Rémi Debette"><img src="https://yellow-cdn.veclightyear.com/0a4dffa0/675b5038-0a92-482b-bc56-f5cb9133e35b.png" height="auto" width="50" style="border-radius:50%"></a> </div>

免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方 案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号