Class RescaleObservation<TObs, TAct>
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
TObsThe env's observation type: arrays (NDArray, or object holding them).
TActThe action type, passed through.
- Inheritance
-
ObservationWrapper<NDArray, TObs, TAct>TransformObservation<NDArray, 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
envEnv<TObs, TAct>The env to wrap.
optionsRescaleObservationOptionsThe options.
Exceptions
- ArgumentNullException
Thrown when
optionsis 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
envEnv<TObs, TAct>The env; its observation space must be a
Box.minObsobjectThe new lower bound: an array of the space's shape, or a number (RescaleBox(Space, object, object)).
maxObsobjectThe new upper bound, in the same forms.
Exceptions
- TypeError
Thrown when the space is no
Boxor a bound has the wrong type (Gymnasium's messages), orenvis null.- ValueError
Thrown when the bounds do not fit the space (see RescaleBox(Space, object, object)).