Crate border_py_gym_env
source ·Expand description
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.
Modules
Structs
- An observation filter for dict of arrays.
- Configuration of
ArrayDictObsFilter
. - An observation filter that convertes PyObject of an numpy array.
- Raw filter for continuous actions.
- Configuration of
ContinuousActFilter
. - Convert discrete action to PyObject.
- Configuration of
DiscreteActFilter
. - An observation filter with stacking sequence of original observations.
- Represents an action.
- Represents action.
- An environment in OpenAI gym.
- Configuration of
GymEnv
. - Information given at every step of the interaction with the environment.
- GymObsDeprecatedObservation represented by an ndarray::ArrayD.
Enums
- Specifies training or evaluation mode.
Traits
Functions
- Convert
ArrayD<f32>
toPyObject
.