Class TransformRewardVector<TObs, TAct>
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
TObsThe batched observation type, passed through.
TActThe batched action type, passed through.
- Inheritance
-
VectorEnv<TObs, TAct>VectorWrapper<TObs, TAct, TObs, TAct>VectorRewardWrapper<TObs, TAct>TransformRewardVector<TObs, TAct>
- Implements
- Inherited Members
- Extension Methods
Remarks
Reference: gymnasium/wrappers/vector/vectorize_reward.py.
Constructors
TransformRewardVector(VectorEnv<TObs, TAct>, Func<NDArray, NDArray>)
Wraps env.
public TransformRewardVector(VectorEnv<TObs, TAct> env, Func<NDArray, NDArray> func)
Parameters
envVectorEnv<TObs, TAct>The vector env.
funcFunc<NDArray, NDArray>The function of the float64 reward array.
Exceptions
Properties
Func
The function of the batched rewards (func).
public Func<NDArray, NDArray> Func { get; set; }
Property Value
Methods
Rewards(NDArray)
Applies Func to the batch.
public override NDArray Rewards(NDArray rewards)
Parameters
rewardsNDArrayThe env's rewards.
Returns
- NDArray
The function's result.