td0_return_estimate¶
- class torchrl.objectives.value.functional.td0_return_estimate(gamma: float, next_state_value: torch.Tensor, reward: torch.Tensor, terminated: torch.Tensor | None = None, *, done: torch.Tensor | None = None)[源代码]¶
TD(0) 折扣回报估计的轨迹。
也称为自举时间差或一步回报。
- 参数:
gamma (scalar) – exponential mean discount.
next_state_value (Tensor) – 使用 new_state 输入的值函数结果。必须是 [Batch x TimeSteps x 1] 或 [Batch x TimeSteps] 张量
reward (Tensor) – 在环境中采取行动所获得的奖励。必须是 [Batch x TimeSteps x 1] 或 [Batch x TimeSteps] 张量
terminated (Tensor) – 剧集结束的布尔标志。如果未提供,则默认为
done
。
- 关键字参数:
done (Tensor) – 已弃用。请改用
terminated
。
所有张量(值、奖励和完成)都必须具有形状
[*Batch x TimeSteps x *F]
,其中*F
是特征维度。