跳转到主要内容

为Gymnasium和PettingZoo提供包装器

项目描述

SuperSuit引入了一组小函数,可以将强化学习环境进行预处理('microwrappers')。我们支持Gymnasium用于单智能体环境,以及PettingZoo用于多智能体环境(AECEnv和ParallelEnv环境)。

使用Gymnasium将其应用于太空入侵者,以将其转换为具有灰度观察空间的类似操作,如下所示

import gymnasium
from supersuit import color_reduction_v0, frame_stack_v1

env = gymnasium.make('SpaceInvaders-v0')

env = frame_stack_v1(color_reduction_v0(env, 'full'), 4)

同样,使用SuperSuit与PettingZoo环境类似

from pettingzoo.butterfly import pistonball_v0
env = pistonball_v0.env()

env = frame_stack_v1(color_reduction_v0(env, 'full'), 4)

请注意:一旦Gymnasium的计划包装器重写完成并且向量API稳定,该项目将被弃用,并作为PettingZoo中新的包装器包的一部分进行重写,同时向量化API也将重新制作,并从Gymnasium当前的功能中获得灵感。

安装SuperSuit

要从pypi安装SuperSuit

python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install supersuit

或者,要从源代码安装SuperSuit,请克隆此存储库,cd到其中,然后

python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -e .

引用

如果您在使用研究时使用此工具,请引用

@article{SuperSuit,
  Title = {SuperSuit: Simple Microwrappers for Reinforcement Learning Environments},
  Author = {Terry, J. K and Black, Benjamin and Hari, Ananth},
  journal={arXiv preprint arXiv:2008.08932},
  year={2020}
}

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

supersuit-3.9.3.tar.gz (34.3 kB 查看散列值)

上传时间 源代码

构建分发

SuperSuit-3.9.3-py3-none-any.whl (50.2 kB 查看散列值)

上传时间 Python 3

由以下赞助商支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面