Update vector wrapper docs and add Env generic to doc (#847)

This commit is contained in:
Mark Towers
2023-12-22 14:48:22 +00:00
committed by GitHub
parent d756522eeb
commit 3b856dec96
59 changed files with 159 additions and 55 deletions

View File

@@ -2,7 +2,7 @@
title: Vector
---
# Vector environments
# Vectorize
```{toctree}
:hidden:
@@ -19,10 +19,10 @@ vector/utils
```
### Methods
```{eval-rst}
.. automethod:: gymnasium.vector.VectorEnv.reset
.. automethod:: gymnasium.vector.VectorEnv.step
.. automethod:: gymnasium.vector.VectorEnv.reset
.. automethod:: gymnasium.vector.VectorEnv.render
.. automethod:: gymnasium.vector.VectorEnv.close
```
@@ -47,11 +47,19 @@ vector/utils
.. autoattribute:: gymnasium.vector.VectorEnv.single_observation_space
The observation space of an environment copy.
The observation space of a sub-environment.
.. autoattribute:: gymnasium.vector.VectorEnv.spec
The ``EnvSpec`` of the environment normally set during :py:meth:`gymnasium.make_vec`
.. autoattribute:: gymnasium.vector.VectorEnv.render_mode
The render mode of the environment which should follow similar specifications to `Env.render_mode`.
.. autoattribute:: gymnasium.vector.VectorEnv.closed
If the vector environment has been closed already.
```
### Additional Methods

View File

@@ -2,19 +2,19 @@
title: Vector Wrappers
---
# Vector Wrappers
# Wrappers
```{eval-rst}
.. autoclass:: gymnasium.vector.VectorWrapper
.. automethod:: gymnasium.vector.VectorWrapper.step
.. automethod:: gymnasium.vector.VectorWrapper.reset
.. automethod:: gymnasium.vector.VectorWrapper.render
.. automethod:: gymnasium.vector.VectorWrapper.close
.. autoclass:: gymnasium.vector.VectorObservationWrapper
.. automethod:: gymnasium.vector.VectorObservationWrapper.vector_observation
.. automethod:: gymnasium.vector.VectorObservationWrapper.single_observation
.. automethod:: gymnasium.vector.VectorObservationWrapper.observations
.. autoclass:: gymnasium.vector.VectorActionWrapper
@@ -24,3 +24,57 @@ title: Vector Wrappers
.. automethod:: gymnasium.vector.VectorRewardWrapper.rewards
```
## Vector Only wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.DictInfoToList
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformObservation
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformAction
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformReward
```
## Vectorized Common wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.RecordEpisodeStatistics
```
## Implemented Observation wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.TransformObservation
.. autoclass:: gymnasium.wrappers.vector.FilterObservation
.. autoclass:: gymnasium.wrappers.vector.FlattenObservation
.. autoclass:: gymnasium.wrappers.vector.GrayscaleObservation
.. autoclass:: gymnasium.wrappers.vector.ResizeObservation
.. autoclass:: gymnasium.wrappers.vector.ReshapeObservation
.. autoclass:: gymnasium.wrappers.vector.RescaleObservation
.. autoclass:: gymnasium.wrappers.vector.DtypeObservation
.. autoclass:: gymnasium.wrappers.vector.NormalizeObservation
```
## Implemented Action wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.TransformAction
.. autoclass:: gymnasium.wrappers.vector.ClipAction
.. autoclass:: gymnasium.wrappers.vector.RescaleAction
```
## Implemented Reward wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.TransformReward
.. autoclass:: gymnasium.wrappers.vector.ClipReward
.. autoclass:: gymnasium.wrappers.vector.NormalizeReward
```
## Implemented Data Conversion wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.JaxToNumpy
.. autoclass:: gymnasium.wrappers.vector.JaxToTorch
.. autoclass:: gymnasium.wrappers.vector.NumpyToTorch
```

View File

@@ -78,7 +78,6 @@ wrapper in the page on the wrapper type
- Applies a function to the ``observation`` received from the environment's ``reset`` and ``step`` that is passed back to the user.
* - :class:`TransformReward`
- Applies a function to the ``reward`` received from the environment's ``step``.
```
## Vector only Wrappers

View File

@@ -1,19 +0,0 @@
---
title: Vector Wrappers
---
# Vector wrappers
## Vector only wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.DictInfoToList
```
## Vectorize Transform Wrappers to Vector Wrappers
```{eval-rst}
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformObservation
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformAction
.. autoclass:: gymnasium.wrappers.vector.VectorizeTransformReward
```