/gym-balletenv

🌎 Gym-style implementation of the original Ballet environment

Primary LanguagePythonApache License 2.0Apache-2.0

gym-balletenv

Gym-style implementation of the original dm_env style Ballet environment which is introduced in Towards mental time travel: a hierarchical memory for reinforcement learning agents.

Featuers

Installation

git clone https://github.com/jinPrelude/gym-balletenv.git
cd gym-balletenv
pip install -e .

Usage

Example code for gym-balletenv :

from gym_balletenv.envs import BalletEnvironment
from gym_balletenv.wrappers import GrayScaleObservation


env = BalletEnvironment(env_id="2_delay16", max_steps=320)
env = GrayScaleObservation(env)

obs, info = env.reset(seed=0)
terminated = False
while not terminated:
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)

Check out the repo gym-balletenv-example more usage of gym-balletenv and its wrappers.

Easy mode

Easy mode is a custom feature that removes various color options and limited dancer shape by the number of dancers. So all the colors of the dancers are "red", and only 4 shape of the dancers will be sampling for 4 dancers environment. This feature is made for rapid model evaluation purpose.

Simply add "_easy" at the end of the env_id :

from gym_balletenv.envs import BalletEnvironment

env = BalletEnvironment(env_id="2_delay2_easy", max_step=320)