Table of Contents

Class TransformRewardVector<TObs, TAct>

Namespace
Gym.Wrappers.Vector
Assembly
Gym.dll

Applies one function to the whole batch of rewards (Gymnasium's vector TransformReward).

[PyName("TransformReward")]
public class TransformRewardVector<TObs, TAct> : VectorRewardWrapper<TObs, TAct>, IVectorEnv, IDisposable

Type Parameters

TObs

The batched observation type, passed through.

TAct

The batched action type, passed through.

Inheritance
VectorEnv<TObs, TAct>
VectorWrapper<TObs, TAct, TObs, TAct>
TransformRewardVector<TObs, TAct>
Implements
Inherited Members
Extension Methods

Remarks

Constructors

TransformRewardVector(VectorEnv<TObs, TAct>, Func<NDArray, NDArray>)

Wraps env.

public TransformRewardVector(VectorEnv<TObs, TAct> env, Func<NDArray, NDArray> func)

Parameters

env VectorEnv<TObs, TAct>

The vector env.

func Func<NDArray, NDArray>

The function of the float64 reward array.

Exceptions

TypeError

Thrown when env is null.

Properties

Func

The function of the batched rewards (func).

public Func<NDArray, NDArray> Func { get; set; }

Property Value

Func<NDArray, NDArray>

Methods

Rewards(NDArray)

Applies Func to the batch.

public override NDArray Rewards(NDArray rewards)

Parameters

rewards NDArray

The env's rewards.

Returns

NDArray

The function's result.