arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.36075cs.LGcs.DL
收藏

Jaxnasium:面向任意智能体、跨套件强化学习的PyTrees应用

Jaxnasium: Embracing PyTrees For Any-Agent, Cross-Suite Reinforcement Learning

Leiden Institute of Advanced Computer Science(莱顿高级计算机科学研究所);Leiden University(莱顿大学)

Koen Ponse, Aske Plaat, Thomas M. Moerland

AI总结:

Jaxnasium是基于JAX的强化学习库,以PyTrees统一空间表示,支持跨套件、多智能体环境,可兼容Gymnasium等套件,提供多种子评估等工具,提升了JAX强化学习的易用性。

摘要:

近年来,基于JAX的硬件加速强化学习迅速普及,已被证明是扩展在线强化学习的有效方法。然而,由此形成的生态系统存在碎片化问题:环境套件定义了各自的接口,算法实现通常仅针对单一套件、单一类型的空间,且要么是JAX原生环境,要么是基于主机的环境。本文提出Jaxnasium,一个基于JAX的强化学习库,旨在提升该领域的易用性。Jaxnasium将观测空间和动作空间表示为PyTrees,并利用该结构构建网络、支持多智能体处理。通过这种设计,其近单文件实现可运行于离散、连续、图像及复合空间,以及多智能体环境,且无需修改算法代码。这些文件既作为可读性强、适合研究的算法,也可作为可导入的算法用于更实用的工作负载。通过极简的Gymnasium风格接口及11个套件的包装器,Jaxnasium提供了300余个环境,在这些环境中,采用默认超参数的小型PPO实现可运行。此外,通过简单的包装器,可使用相同算法和训练循环运行Gymnasium和EnvPool环境,且与专门为基于主机的JAX算法训练构建的架构相比,无性能损失。Jaxnasium还提供多种子评估、超参数搜索及项目脚手架工具,其开源地址为this https URL。

英文摘要:

Hardware-accelerated reinforcement learning in JAX has gained rapid popularity in recent years and has proven to be a successful method of scaling online reinforcement learning. The resulting ecosystem, however, is fragmented: environment suites define their own interfaces, and algorithm implementations are typically written for a single suite, a single type of space, and either JAX-native or host-based environments. Here we present Jaxnasium, a library for JAX-based reinforcement learning, aiming to make the field more accessible. Jaxnasium represents observation and action spaces as PyTrees, and uses this structure to build networks and support multi-agent processing. Through this, its near-single-file implementations run on discrete, continuous, image, and composite spaces, as well as in multi-agent environments, without any changes to the algorithm code. The same files serve as readable, research-friendly algorithms, as well as importable algorithms for more applied workloads. Through a minimal Gymnasium-style interface and wrappers for 11 suites, over 300 environments are available on which a small PPO implementation with default hyperparameters is able to run. Additionally, through a simple wrapper, we can run Gymnasium and EnvPool environments with the same algorithm and training loop, with no performance loss compared to architectures specifically built for training JAX algorithms on host-based environments. Jaxnasium further provides tools for multi-seed evaluation, hyperparameter sweeps, and project scaffolding. Jaxnasium is open-sourced at https://github.com/ponseko/jaxnasium

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑