Namespace Gym.Wrappers.Vector
Classes
- ClipActionVector<TObs, TAct>
Clips each sub-env's action into the env's
Box(Gymnasium's vectorClipAction).
- 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
DictInfoToListdoes: each key's array is split by sub-env, the_keymasks 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
Dictor positions of aTupleobservation, per sub-env (Gymnasium's vectorFilterObservation).
- 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
HumanRenderingdoes: every reset and step renders the sub-envs, scales each frame to fit the grid (OpenCV's bilinearcv2.resize), and shows the mosaic atmetadata["render_fps"].
- NormalizeObservationVector<TAct>
Normalizes the batched observations by running statistics, as Gymnasium's vector
NormalizeObservationdoes: every batch updates the mean and variance (one update ofnum_envsrows), and the observations come back asfloat32((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
NormalizeRewarddoes:reward / sqrt(var + epsilon), where the returns accumulate per sub-env with discountgamma.
- RecordEpisodeStatisticsVector<TObs, TAct>
Records each sub-env's episode return, length and duration, as Gymnasium's vector
RecordEpisodeStatisticsdoes: a step that ends episodes addsinfos["episode"] = {"r", "l", "t"}(zeros for the sub-envs that did not end) andinfos["_episode"](which did), and the lastbuffer_lengthepisodes 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
RecordVideodoes: episodes are counted on the first sub-env, the grid's shape is the one closest tovideo_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 vectorRescaleAction).
- RescaleObservationVector<TObs, TAct>
Rescales each sub-env's
Boxobservation affinely onto new bounds (Gymnasium's vectorRescaleObservation).
- 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
TransformActiondoes; 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
TransformObservationdoes; 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).