Table of Contents

Namespace Gym.Wrappers.Vector

Classes

ClipActionVector<TObs, TAct>

Clips each sub-env's action into the env's Box (Gymnasium's vector ClipAction).

ClipRewardVector<TObs, TAct>

Clips each sub-env's reward between bounds (Gymnasium's vector ClipReward).

DictInfoToList<TObs, TAct>

Converts the vector env's dict of batched infos into a list of one info dict per sub-env, as Gymnasium's DictInfoToList does: each key's array is split by sub-env, the _key masks say which sub-envs have the key, and nested dicts convert likewise.

DtypeObservationVector<TObs, TAct>

Casts each sub-env's observation to a dtype (Gymnasium's vector DtypeObservation).

FilterObservationVector<TObs, TAct>

Keeps the chosen keys of a Dict or positions of a Tuple observation, per sub-env (Gymnasium's vector FilterObservation).

FlattenObservationVector<TObs, TAct>

Flattens each sub-env's observation (Gymnasium's vector FlattenObservation).

GrayscaleObservationVector<TObs, TAct>

Turns each sub-env's RGB image gray (Gymnasium's vector GrayscaleObservation).

HumanRenderingVector<TObs, TAct>

Shows a vector env's sub-envs in one window, tiled, as Gymnasium's vector HumanRendering does: every reset and step renders the sub-envs, scales each frame to fit the grid (OpenCV's bilinear cv2.resize), and shows the mosaic at metadata["render_fps"].

NormalizeObservationVector<TAct>

Normalizes the batched observations by running statistics, as Gymnasium's vector NormalizeObservation does: every batch updates the mean and variance (one update of num_envs rows), and the observations come back as float32((obs - mean) / sqrt(var + epsilon)).

NormalizeRewardVector<TObs, TAct>

Scales the batched rewards by the running standard deviation of each sub-env's discounted return, as Gymnasium's vector NormalizeReward does: reward / sqrt(var + epsilon), where the returns accumulate per sub-env with discount gamma.

RecordEpisodeStatisticsVector<TObs, TAct>

Records each sub-env's episode return, length and duration, as Gymnasium's vector RecordEpisodeStatistics does: a step that ends episodes adds infos["episode"] = {"r", "l", "t"} (zeros for the sub-envs that did not end) and infos["_episode"] (which did), and the last buffer_length episodes stay in the queues.

RecordVideoVector<TObs, TAct>

Records videos of a vector env's episodes, the sub-envs' frames tiled into one frame, as Gymnasium's vector RecordVideo does: episodes are counted on the first sub-env, the grid's shape is the one closest to video_aspect_ratio, and each video goes through an IVideoWriter (DR-25).

RescaleActionVector<TObs, TAct>

Rescales each sub-env's action from new bounds onto the env's Box (Gymnasium's vector RescaleAction).

RescaleObservationVector<TObs, TAct>

Rescales each sub-env's Box observation affinely onto new bounds (Gymnasium's vector RescaleObservation).

ReshapeObservationVector<TObs, TAct>

Reshapes each sub-env's observation (Gymnasium's vector ReshapeObservation).

ResizeObservationVector<TObs, TAct>

Resizes each sub-env's image by OpenCV's area interpolation (Gymnasium's vector ResizeObservation).

TransformActionVector<TObs, TWAct, TAct>

Applies one function to the whole batch of actions, as Gymnasium's vector TransformAction does; give the spaces when the function's input differs from the env's actions.

TransformObservationVector<TWObs, TObs, TAct>

Applies one function to the whole batch of observations, as Gymnasium's vector TransformObservation does; give the spaces when the function changes them. Use VectorizeTransformObservation<TWObs, TObs, TAct> to apply a single-env wrapper's function per sub-env instead.

TransformRewardVector<TObs, TAct>

Applies one function to the whole batch of rewards (Gymnasium's vector TransformReward).

VectorizeTransformAction<TObs, TWAct, TAct>

Vectorizes a single-env action transform (Gymnasium's VectorizeTransformAction): the wrapper class is built over a stand-in env of the single action space, and its function is applied to each sub-env's action.

VectorizeTransformObservation<TWObs, TObs, TAct>

Vectorizes a single-env observation transform (Gymnasium's VectorizeTransformObservation): the wrapper class is built over a stand-in env of the single space, and its function is applied to each sub-env's observation, the results stacked into the batch.

VectorizeTransformReward<TObs, TAct>

Vectorizes a single-env reward transform (Gymnasium's VectorizeTransformReward): the wrapper class is built over a bare stand-in env, and its function is applied to each sub-env's reward, in place.

Structs

VectorListResetResult<TObs>

A vector reset whose infos are one dict per sub-env (DictInfoToList<TObs, TAct>'s result).

VectorListStepResult<TObs>

A vector step whose infos are one dict per sub-env (DictInfoToList<TObs, TAct>'s result).