Table of Contents

Class RescaleObservation<TObs, TAct>

Namespace
Gym.Wrappers
Assembly
Gym.dll

Rescales a Box observation affinely onto [min_obs, max_obs], as Gymnasium's RescaleObservation does; unbounded components must stay unbounded and are only shifted.

public class RescaleObservation<TObs, TAct> : TransformObservation<NDArray, TObs, TAct>, IDynamicAttributes, IWrapper, IEnv, IDisposable, IRecordConstructorArgs

Type Parameters

TObs

The env's observation type: arrays (NDArray, or object holding them).

TAct

The action type, passed through.

Inheritance
Env<NDArray, TAct>
Wrapper<NDArray, TAct, TObs, TAct>
RescaleObservation<TObs, TAct>
Implements
Inherited Members
Extension Methods

Remarks

Each observation is gradient * obs + intercept, both arrays in the space's dtype, computed as RescaleBox(Space, object, object) does (Windows NumPy's float64 path).

Reference: gymnasium/wrappers/transform_observation.py.

Constructors

RescaleObservation(Env<TObs, TAct>, RescaleObservationOptions)

Builds the instance from its options record: the properties set, the constructor's defaults for the rest.

public RescaleObservation(Env<TObs, TAct> env, RescaleObservationOptions options)

Parameters

env Env<TObs, TAct>

The env to wrap.

options RescaleObservationOptions

The options.

Exceptions

ArgumentNullException

Thrown when options is null.

TypeError

Thrown when a required argument is unset, with Python's missing-argument message.

RescaleObservation(Env<TObs, TAct>, object, object)

Wraps env.

public RescaleObservation(Env<TObs, TAct> env, object minObs, object maxObs)

Parameters

env Env<TObs, TAct>

The env; its observation space must be a Box.

minObs object

The new lower bound: an array of the space's shape, or a number (RescaleBox(Space, object, object)).

maxObs object

The new upper bound, in the same forms.

Exceptions

TypeError

Thrown when the space is no Box or a bound has the wrong type (Gymnasium's messages), or env is null.

ValueError

Thrown when the bounds do not fit the space (see RescaleBox(Space, object, object)).