Wrappers for Gymnasium and PettingZoo
Project description
SuperSuit introduces a collection of small functions which can wrap reinforcement learning environments to do preprocessing ('microwrappers'). We support Gymnasium for single agent environments and PettingZoo for multi-agent environments (both AECEnv and ParallelEnv environments).
Using it with Gymnasium to convert space invaders to have a grey scale observation space and stack the last 4 frames looks like:
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)
Similarly, using SuperSuit with PettingZoo environments looks like
from pettingzoo.butterfly import pistonball_v0
env = pistonball_v0.env()
env = frame_stack_v1(color_reduction_v0(env, 'full'), 4)
Please note: Once the planned wrapper rewrite of Gymnasium is complete and the vector API is stabilized, this project will be deprecated and rewritten as part of a new wrappers package in PettingZoo and the vectorized API will be redone, taking inspiration from the functionality currently in Gymnasium.
Installing SuperSuit
To install SuperSuit from pypi:
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install supersuit
Alternatively, to install SuperSuit from source, clone this repo, cd
to it, and then:
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -e .
Citation
If you use this in your research, please cite:
@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}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SuperSuit-3.9.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f30ab6fd9fe720ea7fa73d45a96935b6321c4ea1aa45d7997684c09f39aa10de |
|
MD5 | 10aaa1234ded2ff4b90b0e63c773177e |
|
BLAKE2b-256 | 40aa63ba1c60e15334918abf1991ad1584d2dfc5760b352cba5cb98d61e7ef20 |