#rl #gym #border


Reinforcement learning library

3 releases

new 0.0.6 Sep 19, 2023
0.0.5 Jan 25, 2022
0.0.4 Jul 18, 2021

#694 in Science

Download history 11/week @ 2023-06-01 17/week @ 2023-06-15 14/week @ 2023-06-22 9/week @ 2023-06-29 8/week @ 2023-07-06 6/week @ 2023-07-13 16/week @ 2023-07-20 11/week @ 2023-07-27 6/week @ 2023-08-03 8/week @ 2023-08-10 11/week @ 2023-08-17 8/week @ 2023-08-24 6/week @ 2023-08-31 14/week @ 2023-09-07 28/week @ 2023-09-14

56 downloads per month
Used in 2 crates


2.5K SLoC

A wrapper of Gymnasium environments on Python.

GymEnv is a wrapper of Gymnasium based on PyO3. It has been tested on some of classic control and Gymnasium-Robotics environments.

In a past, [`Atari`](https://gym.openai.com/envs/#atari), and
[`PyBullet`](https://github.com/benelot/pybullet-gym) environments were supported.
However, currently they are not tested.

This wrapper accepts array-like observation and action (Box spaces), and discrete action. In order to interact with Python interpreter where gym is running, GymObsFilter and GymActFilter provides interfaces for converting Python object (numpy array) to/from ndarrays in Rust. GymObsFilter, ContinuousActFilter and DiscreteActFilter do the conversion for environments where observation and action are arrays. In addition to the data conversion between Python and Rust, we can implements arbitrary preprocessing in these filters. For example, FrameStackFilter keeps four consevutive observation frames (images) and outputs a stack of these frames.

For Atari environments, a tweaked version of atari_wrapper.py is required to be in PYTHONPATH. The frame stacking preprocessing is implemented in FrameStackFilter as an GymObsFilter.

Examples with a random controller (Policy) are in examples directory. Examples with border-tch-agents, which are collections of RL agents implemented with tch-rs, are in here.


~434K SLoC