Table of Contents

Class RescaleAction<TObs, TAct>

Namespace
Gym.Wrappers
Assembly
Gym.dll

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

TObs

The observation type, passed through.

TAct

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

Inheritance
Env<TObs, NDArray>
Wrapper<TObs, NDArray, TObs, TAct>
ActionWrapper<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

env Env<TObs, TAct>

The env to wrap.

options RescaleActionOptions

The options.

Exceptions

ArgumentNullException

Thrown when options is 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

env Env<TObs, TAct>

The env; its action space must be a Box.

minAction object

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

maxAction object

The wrapper's upper bound, in the same forms.

Exceptions

TypeError

Thrown when the action 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)).

InvalidBound

Thrown when a component's new bounds are equal, with Gymnasium's message.