Class RescaleAction<TObs, TAct>
Takes actions in [min_action, max_action] and rescales them affinely onto the env's Box bounds, as
Gymnasium's RescaleAction does (the inverse of RescaleBox(Space, object, object)'s map).
public class RescaleAction<TObs, TAct> : TransformAction<TObs, NDArray, TAct>, IDynamicAttributes, IWrapper, IEnv, IDisposable, IRecordConstructorArgs
Type Parameters
TObsThe observation type, passed through.
TActThe env's action type: arrays (NDArray, or object holding them).
- Inheritance
-
ActionWrapper<TObs, NDArray, TAct>TransformAction<TObs, NDArray, TAct>RescaleAction<TObs, TAct>
- Implements
- Inherited Members
- Extension Methods
Remarks
Each step's action is (action - intercept) / gradient, a new array in NumPy's promotion of the action with
the env's dtype. A component whose new bounds coincide has no inverse and is refused at construction.
Reference: gymnasium/wrappers/transform_action.py.
Constructors
RescaleAction(Env<TObs, TAct>, RescaleActionOptions)
Builds the instance from its options record: the properties set, the constructor's defaults for the rest.
public RescaleAction(Env<TObs, TAct> env, RescaleActionOptions options)
Parameters
envEnv<TObs, TAct>The env to wrap.
optionsRescaleActionOptionsThe options.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.- TypeError
Thrown when a required argument is unset, with Python's missing-argument message.
RescaleAction(Env<TObs, TAct>, object, object)
Wraps env.
public RescaleAction(Env<TObs, TAct> env, object minAction, object maxAction)
Parameters
envEnv<TObs, TAct>The env; its action space must be a
Box.minActionobjectThe wrapper's lower bound: an array of the space's shape, or a number (RescaleBox(Space, object, object)).
maxActionobjectThe wrapper's upper bound, in the same forms.
Exceptions
- TypeError
Thrown when the action 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)).
- InvalidBound
Thrown when a component's new bounds are equal, with Gymnasium's message.